Browse Source

Refactor build to include Go

Adding the baclient code to Drydock requires a refactor
of the build automation to support multiple languages
and multiple artifacts included in a single Docker image

NOTE: the go source here is a placeholder 'hello world' sample

Change-Id: I1b4883f018b33b3d4fcd7cbcb6cba660fcdc93de
changes/55/594555/7
Scott Hussey 3 years ago
parent
commit
0f39a55942
  1. 1
      .dockerignore
  2. 4
      .gitignore
  3. 17
      Makefile
  4. 9
      go/src/baclient/baclient.go
  5. 9
      images/drydock/Dockerfile
  6. 0
      python/drydock_provisioner/__init__.py
  7. 0
      python/drydock_provisioner/cli/__init__.py
  8. 0
      python/drydock_provisioner/cli/action.py
  9. 0
      python/drydock_provisioner/cli/commands.py
  10. 0
      python/drydock_provisioner/cli/const.py
  11. 0
      python/drydock_provisioner/cli/design/__init__.py
  12. 0
      python/drydock_provisioner/cli/design/actions.py
  13. 0
      python/drydock_provisioner/cli/design/commands.py
  14. 0
      python/drydock_provisioner/cli/node/__init__.py
  15. 0
      python/drydock_provisioner/cli/node/actions.py
  16. 0
      python/drydock_provisioner/cli/node/commands.py
  17. 0
      python/drydock_provisioner/cli/part/__init__.py
  18. 0
      python/drydock_provisioner/cli/part/actions.py
  19. 0
      python/drydock_provisioner/cli/part/commands.py
  20. 0
      python/drydock_provisioner/cli/task/__init__.py
  21. 0
      python/drydock_provisioner/cli/task/actions.py
  22. 0
      python/drydock_provisioner/cli/task/commands.py
  23. 0
      python/drydock_provisioner/config.py
  24. 0
      python/drydock_provisioner/control/__init__.py
  25. 0
      python/drydock_provisioner/control/api.py
  26. 0
      python/drydock_provisioner/control/base.py
  27. 0
      python/drydock_provisioner/control/bootaction.py
  28. 0
      python/drydock_provisioner/control/designs.py
  29. 0
      python/drydock_provisioner/control/health.py
  30. 0
      python/drydock_provisioner/control/middleware.py
  31. 0
      python/drydock_provisioner/control/nodes.py
  32. 0
      python/drydock_provisioner/control/readme.md
  33. 0
      python/drydock_provisioner/control/tasks.py
  34. 0
      python/drydock_provisioner/control/util.py
  35. 0
      python/drydock_provisioner/control/validation.py
  36. 0
      python/drydock_provisioner/drivers/__init__.py
  37. 0
      python/drydock_provisioner/drivers/driver.py
  38. 0
      python/drydock_provisioner/drivers/node/__init__.py
  39. 0
      python/drydock_provisioner/drivers/node/driver.py
  40. 0
      python/drydock_provisioner/drivers/node/maasdriver/__init__.py
  41. 0
      python/drydock_provisioner/drivers/node/maasdriver/actions/__init__.py
  42. 0
      python/drydock_provisioner/drivers/node/maasdriver/actions/node.py
  43. 0
      python/drydock_provisioner/drivers/node/maasdriver/api_client.py
  44. 0
      python/drydock_provisioner/drivers/node/maasdriver/driver.py
  45. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/__init__.py
  46. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/base.py
  47. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/blockdev.py
  48. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/boot_resource.py
  49. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/domain.py
  50. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/fabric.py
  51. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/interface.py
  52. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/iprange.py
  53. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/machine.py
  54. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/node_results.py
  55. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/partition.py
  56. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/rack_controller.py
  57. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/repository.py
  58. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/sshkey.py
  59. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/staticroute.py
  60. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/subnet.py
  61. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/tag.py
  62. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/vlan.py
  63. 0
      python/drydock_provisioner/drivers/node/maasdriver/models/volumegroup.py
  64. 0
      python/drydock_provisioner/drivers/node/maasdriver/readme.md
  65. 0
      python/drydock_provisioner/drivers/oob/__init__.py
  66. 0
      python/drydock_provisioner/drivers/oob/driver.py
  67. 0
      python/drydock_provisioner/drivers/oob/libvirt_driver/__init__.py
  68. 0
      python/drydock_provisioner/drivers/oob/libvirt_driver/actions/__init__.py
  69. 0
      python/drydock_provisioner/drivers/oob/libvirt_driver/actions/oob.py
  70. 0
      python/drydock_provisioner/drivers/oob/libvirt_driver/driver.py
  71. 0
      python/drydock_provisioner/drivers/oob/manual_driver/__init__.py
  72. 0
      python/drydock_provisioner/drivers/oob/manual_driver/driver.py
  73. 0
      python/drydock_provisioner/drivers/oob/pyghmi_driver/__init__.py
  74. 0
      python/drydock_provisioner/drivers/oob/pyghmi_driver/actions/__init__.py
  75. 0
      python/drydock_provisioner/drivers/oob/pyghmi_driver/actions/oob.py
  76. 0
      python/drydock_provisioner/drivers/oob/pyghmi_driver/driver.py
  77. 0
      python/drydock_provisioner/drivers/readme.md
  78. 0
      python/drydock_provisioner/drydock.py
  79. 0
      python/drydock_provisioner/drydock_client/__init__.py
  80. 0
      python/drydock_provisioner/drydock_client/client.py
  81. 0
      python/drydock_provisioner/drydock_client/session.py
  82. 0
      python/drydock_provisioner/error.py
  83. 0
      python/drydock_provisioner/ingester/__init__.py
  84. 0
      python/drydock_provisioner/ingester/ingester.py
  85. 0
      python/drydock_provisioner/ingester/plugins/__init__.py
  86. 0
      python/drydock_provisioner/ingester/plugins/deckhand.py
  87. 0
      python/drydock_provisioner/ingester/plugins/yaml.py
  88. 0
      python/drydock_provisioner/ingester/readme.md
  89. 0
      python/drydock_provisioner/introspection/readme.md
  90. 0
      python/drydock_provisioner/objects/__init__.py
  91. 0
      python/drydock_provisioner/objects/base.py
  92. 0
      python/drydock_provisioner/objects/bootaction.py
  93. 0
      python/drydock_provisioner/objects/builddata.py
  94. 0
      python/drydock_provisioner/objects/fields.py
  95. 0
      python/drydock_provisioner/objects/healthcheck.py
  96. 0
      python/drydock_provisioner/objects/hostprofile.py
  97. 0
      python/drydock_provisioner/objects/hwprofile.py
  98. 0
      python/drydock_provisioner/objects/network.py
  99. 0
      python/drydock_provisioner/objects/node.py
  100. 0
      python/drydock_provisioner/objects/promenade.py

1
.dockerignore

@ -1,2 +1 @@
.tox
**/build

4
.gitignore

@ -104,3 +104,7 @@ ENV/
# VIM
.*.swp
# Chart artifacts
charts/drydock/charts
charts/drydock/requirements.lock

17
Makefile

@ -12,18 +12,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
BUILD_DIR := $(shell mktemp -d)
BUILD_DIR := $(shell mkdir -p build && mktemp -d -p build)
DOCKER_REGISTRY ?= quay.io
IMAGE_NAME ?= drydock
IMAGE_PREFIX ?= airshipit
IMAGE_TAG ?= dev
HELM := $(BUILD_DIR)/helm
HELM := $(shell realpath $(BUILD_DIR))/helm
PROXY ?= http://proxy.foo.com:8000
NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
USE_PROXY ?= false
PUSH_IMAGE ?= false
LABEL ?= commit-id
IMAGE ?= ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
GO_BUILDER ?= docker.io/golang:1.10-alpine
export
# Build all docker images for this project
@ -101,12 +103,17 @@ helm-install:
# Make targets intended for use by the primary targets above.
.PHONY: build_drydock
build_drydock: external_dep
build_drydock: external_dep build_baclient
export; tools/drydock_image_build.sh
ifeq ($(PUSH_IMAGE), true)
docker push $(IMAGE)
endif
# Make target for building bootaction signal client
.PHONY: build_baclient
build_baclient: external_dep
docker run -tv $(shell realpath go):/work -v $(shell realpath $(BUILD_DIR)):/build -e GOPATH=/work $(GO_BUILDER) go build -o /build/baclient baclient
.PHONY: docs
docs: clean drydock_docs
@ -132,7 +139,6 @@ genconfig:
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)/*
rm -rf build
rm -rf docs/build
rm -rf charts/drydock/charts
@ -143,6 +149,5 @@ pep8: external_dep
tox -e pep8
.PHONY: helm_lint
helm_lint: clean helm-init
tools/helm_tk.sh $(HELM)
helm_lint: helm-init
$(HELM) lint charts/drydock

9
go/src/baclient/baclient.go

@ -0,0 +1,9 @@
package main
import (
"fmt"
)
func main() {
fmt.Printf("Hello World!\n")
}

9
images/drydock/Dockerfile

@ -18,6 +18,7 @@ ARG TRUSTED_UBUNTU_REPO=no
ARG ALLOW_UNAUTHENTICATED=false
ARG PIP_TRUSTED_HOST=foo.com
ARG PIP_INDEX_URL=https://pypi.org/simple
ARG BUILD_DIR
ENV container docker
ENV PORT 9000
ENV LC_ALL C.UTF-8
@ -37,15 +38,15 @@ WORKDIR /tmp/drydock
RUN ./hostdeps.sh; \
rm -r /var/lib/apt/lists/*
COPY ./requirements-lock.txt /tmp/drydock/
COPY ./python/requirements-lock.txt /tmp/drydock/
RUN pip3 install \
--no-cache-dir \
-r /tmp/drydock/requirements-lock.txt
COPY ./python /tmp/drydock/python
COPY ${BUILD_DIR}/baclient /tmp/drydock/python/drydock_provisioner/assets/baclient
COPY . /tmp/drydock
WORKDIR /tmp/drydock
WORKDIR /tmp/drydock/python
RUN python3 setup.py install
EXPOSE $PORT

0
drydock_provisioner/__init__.py → python/drydock_provisioner/__init__.py

0
drydock_provisioner/cli/__init__.py → python/drydock_provisioner/cli/__init__.py

0
drydock_provisioner/cli/action.py → python/drydock_provisioner/cli/action.py

0
drydock_provisioner/cli/commands.py → python/drydock_provisioner/cli/commands.py

0
drydock_provisioner/cli/const.py → python/drydock_provisioner/cli/const.py

0
drydock_provisioner/cli/design/__init__.py → python/drydock_provisioner/cli/design/__init__.py

0
drydock_provisioner/cli/design/actions.py → python/drydock_provisioner/cli/design/actions.py

0
drydock_provisioner/cli/design/commands.py → python/drydock_provisioner/cli/design/commands.py

0
drydock_provisioner/cli/node/__init__.py → python/drydock_provisioner/cli/node/__init__.py

0
drydock_provisioner/cli/node/actions.py → python/drydock_provisioner/cli/node/actions.py

0
drydock_provisioner/cli/node/commands.py → python/drydock_provisioner/cli/node/commands.py

0
drydock_provisioner/cli/part/__init__.py → python/drydock_provisioner/cli/part/__init__.py

0
drydock_provisioner/cli/part/actions.py → python/drydock_provisioner/cli/part/actions.py

0
drydock_provisioner/cli/part/commands.py → python/drydock_provisioner/cli/part/commands.py

0
drydock_provisioner/cli/task/__init__.py → python/drydock_provisioner/cli/task/__init__.py

0
drydock_provisioner/cli/task/actions.py → python/drydock_provisioner/cli/task/actions.py

0
drydock_provisioner/cli/task/commands.py → python/drydock_provisioner/cli/task/commands.py

0
drydock_provisioner/config.py → python/drydock_provisioner/config.py

0
drydock_provisioner/control/__init__.py → python/drydock_provisioner/control/__init__.py

0
drydock_provisioner/control/api.py → python/drydock_provisioner/control/api.py

0
drydock_provisioner/control/base.py → python/drydock_provisioner/control/base.py

0
drydock_provisioner/control/bootaction.py → python/drydock_provisioner/control/bootaction.py

0
drydock_provisioner/control/designs.py → python/drydock_provisioner/control/designs.py

0
drydock_provisioner/control/health.py → python/drydock_provisioner/control/health.py

0
drydock_provisioner/control/middleware.py → python/drydock_provisioner/control/middleware.py

0
drydock_provisioner/control/nodes.py → python/drydock_provisioner/control/nodes.py

0
drydock_provisioner/control/readme.md → python/drydock_provisioner/control/readme.md

0
drydock_provisioner/control/tasks.py → python/drydock_provisioner/control/tasks.py

0
drydock_provisioner/control/util.py → python/drydock_provisioner/control/util.py

0
drydock_provisioner/control/validation.py → python/drydock_provisioner/control/validation.py

0
drydock_provisioner/drivers/__init__.py → python/drydock_provisioner/drivers/__init__.py

0
drydock_provisioner/drivers/driver.py → python/drydock_provisioner/drivers/driver.py

0
drydock_provisioner/drivers/node/__init__.py → python/drydock_provisioner/drivers/node/__init__.py

0
drydock_provisioner/drivers/node/driver.py → python/drydock_provisioner/drivers/node/driver.py

0
drydock_provisioner/drivers/node/maasdriver/__init__.py → python/drydock_provisioner/drivers/node/maasdriver/__init__.py

0
drydock_provisioner/drivers/node/maasdriver/actions/__init__.py → python/drydock_provisioner/drivers/node/maasdriver/actions/__init__.py

0
drydock_provisioner/drivers/node/maasdriver/actions/node.py → python/drydock_provisioner/drivers/node/maasdriver/actions/node.py

0
drydock_provisioner/drivers/node/maasdriver/api_client.py → python/drydock_provisioner/drivers/node/maasdriver/api_client.py

0
drydock_provisioner/drivers/node/maasdriver/driver.py → python/drydock_provisioner/drivers/node/maasdriver/driver.py

0
drydock_provisioner/drivers/node/maasdriver/models/__init__.py → python/drydock_provisioner/drivers/node/maasdriver/models/__init__.py

0
drydock_provisioner/drivers/node/maasdriver/models/base.py → python/drydock_provisioner/drivers/node/maasdriver/models/base.py

0
drydock_provisioner/drivers/node/maasdriver/models/blockdev.py → python/drydock_provisioner/drivers/node/maasdriver/models/blockdev.py

0
drydock_provisioner/drivers/node/maasdriver/models/boot_resource.py → python/drydock_provisioner/drivers/node/maasdriver/models/boot_resource.py

0
drydock_provisioner/drivers/node/maasdriver/models/domain.py → python/drydock_provisioner/drivers/node/maasdriver/models/domain.py

0
drydock_provisioner/drivers/node/maasdriver/models/fabric.py → python/drydock_provisioner/drivers/node/maasdriver/models/fabric.py

0
drydock_provisioner/drivers/node/maasdriver/models/interface.py → python/drydock_provisioner/drivers/node/maasdriver/models/interface.py

0
drydock_provisioner/drivers/node/maasdriver/models/iprange.py → python/drydock_provisioner/drivers/node/maasdriver/models/iprange.py

0
drydock_provisioner/drivers/node/maasdriver/models/machine.py → python/drydock_provisioner/drivers/node/maasdriver/models/machine.py

0
drydock_provisioner/drivers/node/maasdriver/models/node_results.py → python/drydock_provisioner/drivers/node/maasdriver/models/node_results.py

0
drydock_provisioner/drivers/node/maasdriver/models/partition.py → python/drydock_provisioner/drivers/node/maasdriver/models/partition.py

0
drydock_provisioner/drivers/node/maasdriver/models/rack_controller.py → python/drydock_provisioner/drivers/node/maasdriver/models/rack_controller.py

0
drydock_provisioner/drivers/node/maasdriver/models/repository.py → python/drydock_provisioner/drivers/node/maasdriver/models/repository.py

0
drydock_provisioner/drivers/node/maasdriver/models/sshkey.py → python/drydock_provisioner/drivers/node/maasdriver/models/sshkey.py

0
drydock_provisioner/drivers/node/maasdriver/models/staticroute.py → python/drydock_provisioner/drivers/node/maasdriver/models/staticroute.py

0
drydock_provisioner/drivers/node/maasdriver/models/subnet.py → python/drydock_provisioner/drivers/node/maasdriver/models/subnet.py

0
drydock_provisioner/drivers/node/maasdriver/models/tag.py → python/drydock_provisioner/drivers/node/maasdriver/models/tag.py

0
drydock_provisioner/drivers/node/maasdriver/models/vlan.py → python/drydock_provisioner/drivers/node/maasdriver/models/vlan.py

0
drydock_provisioner/drivers/node/maasdriver/models/volumegroup.py → python/drydock_provisioner/drivers/node/maasdriver/models/volumegroup.py

0
drydock_provisioner/drivers/node/maasdriver/readme.md → python/drydock_provisioner/drivers/node/maasdriver/readme.md

0
drydock_provisioner/drivers/oob/__init__.py → python/drydock_provisioner/drivers/oob/__init__.py

0
drydock_provisioner/drivers/oob/driver.py → python/drydock_provisioner/drivers/oob/driver.py

0
drydock_provisioner/drivers/oob/libvirt_driver/__init__.py → python/drydock_provisioner/drivers/oob/libvirt_driver/__init__.py

0
drydock_provisioner/drivers/oob/libvirt_driver/actions/__init__.py → python/drydock_provisioner/drivers/oob/libvirt_driver/actions/__init__.py

0
drydock_provisioner/drivers/oob/libvirt_driver/actions/oob.py → python/drydock_provisioner/drivers/oob/libvirt_driver/actions/oob.py

0
drydock_provisioner/drivers/oob/libvirt_driver/driver.py → python/drydock_provisioner/drivers/oob/libvirt_driver/driver.py

0
drydock_provisioner/drivers/oob/manual_driver/__init__.py → python/drydock_provisioner/drivers/oob/manual_driver/__init__.py

0
drydock_provisioner/drivers/oob/manual_driver/driver.py → python/drydock_provisioner/drivers/oob/manual_driver/driver.py

0
drydock_provisioner/drivers/oob/pyghmi_driver/__init__.py → python/drydock_provisioner/drivers/oob/pyghmi_driver/__init__.py

0
drydock_provisioner/drivers/oob/pyghmi_driver/actions/__init__.py → python/drydock_provisioner/drivers/oob/pyghmi_driver/actions/__init__.py

0
drydock_provisioner/drivers/oob/pyghmi_driver/actions/oob.py → python/drydock_provisioner/drivers/oob/pyghmi_driver/actions/oob.py

0
drydock_provisioner/drivers/oob/pyghmi_driver/driver.py → python/drydock_provisioner/drivers/oob/pyghmi_driver/driver.py

0
drydock_provisioner/drivers/readme.md → python/drydock_provisioner/drivers/readme.md

0
drydock_provisioner/drydock.py → python/drydock_provisioner/drydock.py

0
drydock_provisioner/drydock_client/__init__.py → python/drydock_provisioner/drydock_client/__init__.py

0
drydock_provisioner/drydock_client/client.py → python/drydock_provisioner/drydock_client/client.py

0
drydock_provisioner/drydock_client/session.py → python/drydock_provisioner/drydock_client/session.py

0
drydock_provisioner/error.py → python/drydock_provisioner/error.py

0
drydock_provisioner/ingester/__init__.py → python/drydock_provisioner/ingester/__init__.py

0
drydock_provisioner/ingester/ingester.py → python/drydock_provisioner/ingester/ingester.py

0
drydock_provisioner/ingester/plugins/__init__.py → python/drydock_provisioner/ingester/plugins/__init__.py

0
drydock_provisioner/ingester/plugins/deckhand.py → python/drydock_provisioner/ingester/plugins/deckhand.py

0
drydock_provisioner/ingester/plugins/yaml.py → python/drydock_provisioner/ingester/plugins/yaml.py

0
drydock_provisioner/ingester/readme.md → python/drydock_provisioner/ingester/readme.md

0
drydock_provisioner/introspection/readme.md → python/drydock_provisioner/introspection/readme.md

0
drydock_provisioner/objects/__init__.py → python/drydock_provisioner/objects/__init__.py

0
drydock_provisioner/objects/base.py → python/drydock_provisioner/objects/base.py

0
drydock_provisioner/objects/bootaction.py → python/drydock_provisioner/objects/bootaction.py

0
drydock_provisioner/objects/builddata.py → python/drydock_provisioner/objects/builddata.py

0
drydock_provisioner/objects/fields.py → python/drydock_provisioner/objects/fields.py

0
drydock_provisioner/objects/healthcheck.py → python/drydock_provisioner/objects/healthcheck.py

0
drydock_provisioner/objects/hostprofile.py → python/drydock_provisioner/objects/hostprofile.py

0
drydock_provisioner/objects/hwprofile.py → python/drydock_provisioner/objects/hwprofile.py

0
drydock_provisioner/objects/network.py → python/drydock_provisioner/objects/network.py

0
drydock_provisioner/objects/node.py → python/drydock_provisioner/objects/node.py

0
drydock_provisioner/objects/promenade.py → python/drydock_provisioner/objects/promenade.py

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save