diff --git a/.drone.yml b/.drone.yml index 864cdfe8e..097082998 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,3 +1,11 @@ +--- +kind: secret +name: kubeconfig + +get: + path: buildx + name: kubeconfig + --- kind: pipeline name: default @@ -12,6 +20,29 @@ steps: commands: - git fetch --tags +- name: buildx + image: autonomy/build-container:latest + commands: + - apk add coreutils + - echo -e "$BUILDX_KUBECONFIG" > /root/.kube/config + - docker buildx create --driver kubernetes --driver-opt replicas=2 --driver-opt namespace=ci --driver-opt image=moby/buildkit:v0.6.2 --name ci --buildkitd-flags="--allow-insecure-entitlement security.insecure" --use + - docker buildx inspect --bootstrap + environment: + BUILDX_KUBECONFIG: + from_secret: kubeconfig + privileged: true + volumes: + - name: dockersock + path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube + - name: dev + path: /dev + - name: tmp + path: /tmp + - name: machined pull: always image: autonomy/build-container:latest @@ -19,16 +50,19 @@ steps: - make machined environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osd pull: always @@ -37,16 +71,19 @@ steps: - make osd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: apid pull: always @@ -55,16 +92,19 @@ steps: - make apid environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: trustd pull: always @@ -73,16 +113,19 @@ steps: - make trustd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: ntpd pull: always @@ -91,16 +134,19 @@ steps: - make ntpd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: networkd pull: always @@ -109,16 +155,19 @@ steps: - make networkd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osctl-linux pull: always @@ -127,16 +176,19 @@ steps: - make osctl-linux environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osctl-darwin pull: always @@ -145,16 +197,19 @@ steps: - make osctl-darwin environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: integration-test pull: always @@ -163,16 +218,19 @@ steps: - make integration-test environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: rootfs pull: always @@ -181,10 +239,13 @@ steps: - make rootfs environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -204,10 +265,13 @@ steps: - make initramfs environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -222,10 +286,13 @@ steps: - make installer environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -240,10 +307,13 @@ steps: - make container environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -258,14 +328,19 @@ steps: - make lint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: protolint pull: always @@ -274,14 +349,19 @@ steps: - make protolint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: markdownlint pull: always @@ -290,14 +370,19 @@ steps: - make markdownlint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: image-test pull: always @@ -306,10 +391,13 @@ steps: - make image-test environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -324,10 +412,13 @@ steps: - make unit-tests environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -342,10 +433,13 @@ steps: - make unit-tests-race environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -373,10 +467,13 @@ steps: - make basic-integration environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -401,6 +498,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -427,6 +528,10 @@ services: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -435,6 +540,10 @@ services: volumes: - name: dockersock temp: {} +- name: docker + temp: {} +- name: kube + temp: {} - name: dev host: path: /dev @@ -467,6 +576,29 @@ steps: commands: - git fetch --tags +- name: buildx + image: autonomy/build-container:latest + commands: + - apk add coreutils + - echo -e "$BUILDX_KUBECONFIG" > /root/.kube/config + - docker buildx create --driver kubernetes --driver-opt replicas=2 --driver-opt namespace=ci --driver-opt image=moby/buildkit:v0.6.2 --name ci --buildkitd-flags="--allow-insecure-entitlement security.insecure" --use + - docker buildx inspect --bootstrap + environment: + BUILDX_KUBECONFIG: + from_secret: kubeconfig + privileged: true + volumes: + - name: dockersock + path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube + - name: dev + path: /dev + - name: tmp + path: /tmp + - name: machined pull: always image: autonomy/build-container:latest @@ -474,16 +606,19 @@ steps: - make machined environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osd pull: always @@ -492,16 +627,19 @@ steps: - make osd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: apid pull: always @@ -510,16 +648,19 @@ steps: - make apid environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: trustd pull: always @@ -528,16 +669,19 @@ steps: - make trustd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: ntpd pull: always @@ -546,16 +690,19 @@ steps: - make ntpd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: networkd pull: always @@ -564,16 +711,19 @@ steps: - make networkd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osctl-linux pull: always @@ -582,16 +732,19 @@ steps: - make osctl-linux environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osctl-darwin pull: always @@ -600,16 +753,19 @@ steps: - make osctl-darwin environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: integration-test pull: always @@ -618,16 +774,19 @@ steps: - make integration-test environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: rootfs pull: always @@ -636,10 +795,13 @@ steps: - make rootfs environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -659,10 +821,13 @@ steps: - make initramfs environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -677,10 +842,13 @@ steps: - make installer environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -695,10 +863,13 @@ steps: - make container environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -713,14 +884,19 @@ steps: - make lint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: protolint pull: always @@ -729,14 +905,19 @@ steps: - make protolint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: markdownlint pull: always @@ -745,14 +926,19 @@ steps: - make markdownlint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: image-test pull: always @@ -761,10 +947,13 @@ steps: - make image-test environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -779,10 +968,13 @@ steps: - make unit-tests environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -797,10 +989,13 @@ steps: - make unit-tests-race environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -828,10 +1023,13 @@ steps: - make basic-integration environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -856,6 +1054,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -879,7 +1081,6 @@ steps: AZURE_SVC_ACCT: from_secret: azure_svc_acct BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} GCE_SVC_ACCT: from_secret: gce_svc_acct PACKET_AUTH_TOKEN: @@ -887,6 +1088,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -901,10 +1106,13 @@ steps: - make image-aws environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -919,10 +1127,13 @@ steps: - make image-gcp environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -941,7 +1152,6 @@ steps: AZURE_SVC_ACCT: from_secret: azure_svc_acct BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} GCE_SVC_ACCT: from_secret: gce_svc_acct PACKET_AUTH_TOKEN: @@ -949,6 +1159,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -967,7 +1181,6 @@ steps: AZURE_SVC_ACCT: from_secret: azure_svc_acct BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} GCE_SVC_ACCT: from_secret: gce_svc_acct PACKET_AUTH_TOKEN: @@ -975,6 +1188,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -989,11 +1206,14 @@ steps: - make e2e-integration environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} PLATFORM: aws volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1009,11 +1229,14 @@ steps: - make e2e-integration environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} PLATFORM: gcp volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1036,6 +1259,10 @@ services: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1044,6 +1271,10 @@ services: volumes: - name: dockersock temp: {} +- name: docker + temp: {} +- name: kube + temp: {} - name: dev host: path: /dev @@ -1071,6 +1302,29 @@ steps: commands: - git fetch --tags +- name: buildx + image: autonomy/build-container:latest + commands: + - apk add coreutils + - echo -e "$BUILDX_KUBECONFIG" > /root/.kube/config + - docker buildx create --driver kubernetes --driver-opt replicas=2 --driver-opt namespace=ci --driver-opt image=moby/buildkit:v0.6.2 --name ci --buildkitd-flags="--allow-insecure-entitlement security.insecure" --use + - docker buildx inspect --bootstrap + environment: + BUILDX_KUBECONFIG: + from_secret: kubeconfig + privileged: true + volumes: + - name: dockersock + path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube + - name: dev + path: /dev + - name: tmp + path: /tmp + - name: machined pull: always image: autonomy/build-container:latest @@ -1078,16 +1332,19 @@ steps: - make machined environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osd pull: always @@ -1096,16 +1353,19 @@ steps: - make osd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: apid pull: always @@ -1114,16 +1374,19 @@ steps: - make apid environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: trustd pull: always @@ -1132,16 +1395,19 @@ steps: - make trustd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: ntpd pull: always @@ -1150,16 +1416,19 @@ steps: - make ntpd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: networkd pull: always @@ -1168,16 +1437,19 @@ steps: - make networkd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osctl-linux pull: always @@ -1186,16 +1458,19 @@ steps: - make osctl-linux environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osctl-darwin pull: always @@ -1204,16 +1479,19 @@ steps: - make osctl-darwin environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: integration-test pull: always @@ -1222,16 +1500,19 @@ steps: - make integration-test environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: rootfs pull: always @@ -1240,10 +1521,13 @@ steps: - make rootfs environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1263,10 +1547,13 @@ steps: - make initramfs environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1281,10 +1568,13 @@ steps: - make installer environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1299,10 +1589,13 @@ steps: - make container environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1317,14 +1610,19 @@ steps: - make lint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: protolint pull: always @@ -1333,14 +1631,19 @@ steps: - make protolint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: markdownlint pull: always @@ -1349,14 +1652,19 @@ steps: - make markdownlint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: image-test pull: always @@ -1365,10 +1673,13 @@ steps: - make image-test environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1383,10 +1694,13 @@ steps: - make unit-tests environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1401,10 +1715,13 @@ steps: - make unit-tests-race environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1432,10 +1749,13 @@ steps: - make basic-integration environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1460,6 +1780,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1483,7 +1807,6 @@ steps: AZURE_SVC_ACCT: from_secret: azure_svc_acct BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} GCE_SVC_ACCT: from_secret: gce_svc_acct PACKET_AUTH_TOKEN: @@ -1491,6 +1814,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1505,10 +1832,13 @@ steps: - make image-aws environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1523,10 +1853,13 @@ steps: - make image-gcp environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1545,7 +1878,6 @@ steps: AZURE_SVC_ACCT: from_secret: azure_svc_acct BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} GCE_SVC_ACCT: from_secret: gce_svc_acct PACKET_AUTH_TOKEN: @@ -1553,6 +1885,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1571,7 +1907,6 @@ steps: AZURE_SVC_ACCT: from_secret: azure_svc_acct BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} GCE_SVC_ACCT: from_secret: gce_svc_acct PACKET_AUTH_TOKEN: @@ -1579,6 +1914,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1593,12 +1932,15 @@ steps: - make e2e-integration environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} CONFORMANCE: run PLATFORM: aws volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1614,12 +1956,15 @@ steps: - make e2e-integration environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} CONFORMANCE: run PLATFORM: gcp volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1643,6 +1988,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1670,6 +2019,10 @@ services: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1678,6 +2031,10 @@ services: volumes: - name: dockersock temp: {} +- name: docker + temp: {} +- name: kube + temp: {} - name: dev host: path: /dev @@ -1705,6 +2062,29 @@ steps: commands: - git fetch --tags +- name: buildx + image: autonomy/build-container:latest + commands: + - apk add coreutils + - echo -e "$BUILDX_KUBECONFIG" > /root/.kube/config + - docker buildx create --driver kubernetes --driver-opt replicas=2 --driver-opt namespace=ci --driver-opt image=moby/buildkit:v0.6.2 --name ci --buildkitd-flags="--allow-insecure-entitlement security.insecure" --use + - docker buildx inspect --bootstrap + environment: + BUILDX_KUBECONFIG: + from_secret: kubeconfig + privileged: true + volumes: + - name: dockersock + path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube + - name: dev + path: /dev + - name: tmp + path: /tmp + - name: machined pull: always image: autonomy/build-container:latest @@ -1712,16 +2092,19 @@ steps: - make machined environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osd pull: always @@ -1730,16 +2113,19 @@ steps: - make osd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: apid pull: always @@ -1748,16 +2134,19 @@ steps: - make apid environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: trustd pull: always @@ -1766,16 +2155,19 @@ steps: - make trustd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: ntpd pull: always @@ -1784,16 +2176,19 @@ steps: - make ntpd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: networkd pull: always @@ -1802,16 +2197,19 @@ steps: - make networkd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osctl-linux pull: always @@ -1820,16 +2218,19 @@ steps: - make osctl-linux environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osctl-darwin pull: always @@ -1838,16 +2239,19 @@ steps: - make osctl-darwin environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: integration-test pull: always @@ -1856,16 +2260,19 @@ steps: - make integration-test environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: rootfs pull: always @@ -1874,10 +2281,13 @@ steps: - make rootfs environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1897,10 +2307,13 @@ steps: - make initramfs environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1915,10 +2328,13 @@ steps: - make installer environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1933,10 +2349,13 @@ steps: - make container environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -1951,14 +2370,19 @@ steps: - make lint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: protolint pull: always @@ -1967,14 +2391,19 @@ steps: - make protolint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: markdownlint pull: always @@ -1983,14 +2412,19 @@ steps: - make markdownlint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: image-test pull: always @@ -1999,10 +2433,13 @@ steps: - make image-test environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2017,10 +2454,13 @@ steps: - make unit-tests environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2035,10 +2475,13 @@ steps: - make unit-tests-race environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2066,10 +2509,13 @@ steps: - make basic-integration environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2094,6 +2540,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2117,7 +2567,6 @@ steps: AZURE_SVC_ACCT: from_secret: azure_svc_acct BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} GCE_SVC_ACCT: from_secret: gce_svc_acct PACKET_AUTH_TOKEN: @@ -2125,6 +2574,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2139,10 +2592,13 @@ steps: - make image-aws environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2157,10 +2613,13 @@ steps: - make image-gcp environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2179,7 +2638,6 @@ steps: AZURE_SVC_ACCT: from_secret: azure_svc_acct BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} GCE_SVC_ACCT: from_secret: gce_svc_acct PACKET_AUTH_TOKEN: @@ -2187,6 +2645,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2205,7 +2667,6 @@ steps: AZURE_SVC_ACCT: from_secret: azure_svc_acct BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} GCE_SVC_ACCT: from_secret: gce_svc_acct PACKET_AUTH_TOKEN: @@ -2213,6 +2674,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2227,12 +2692,15 @@ steps: - make e2e-integration environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} CONFORMANCE: run PLATFORM: aws volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2248,12 +2716,15 @@ steps: - make e2e-integration environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} CONFORMANCE: run PLATFORM: gcp volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2277,6 +2748,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2304,6 +2779,10 @@ services: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2312,6 +2791,10 @@ services: volumes: - name: dockersock temp: {} +- name: docker + temp: {} +- name: kube + temp: {} - name: dev host: path: /dev @@ -2339,6 +2822,29 @@ steps: commands: - git fetch --tags +- name: buildx + image: autonomy/build-container:latest + commands: + - apk add coreutils + - echo -e "$BUILDX_KUBECONFIG" > /root/.kube/config + - docker buildx create --driver kubernetes --driver-opt replicas=2 --driver-opt namespace=ci --driver-opt image=moby/buildkit:v0.6.2 --name ci --buildkitd-flags="--allow-insecure-entitlement security.insecure" --use + - docker buildx inspect --bootstrap + environment: + BUILDX_KUBECONFIG: + from_secret: kubeconfig + privileged: true + volumes: + - name: dockersock + path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube + - name: dev + path: /dev + - name: tmp + path: /tmp + - name: machined pull: always image: autonomy/build-container:latest @@ -2346,16 +2852,19 @@ steps: - make machined environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osd pull: always @@ -2364,16 +2873,19 @@ steps: - make osd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: apid pull: always @@ -2382,16 +2894,19 @@ steps: - make apid environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: trustd pull: always @@ -2400,16 +2915,19 @@ steps: - make trustd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: ntpd pull: always @@ -2418,16 +2936,19 @@ steps: - make ntpd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: networkd pull: always @@ -2436,16 +2957,19 @@ steps: - make networkd environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osctl-linux pull: always @@ -2454,16 +2978,19 @@ steps: - make osctl-linux environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: osctl-darwin pull: always @@ -2472,16 +2999,19 @@ steps: - make osctl-darwin environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: integration-test pull: always @@ -2490,16 +3020,19 @@ steps: - make integration-test environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp depends_on: - - fetch-tags + - buildx - name: rootfs pull: always @@ -2508,10 +3041,13 @@ steps: - make rootfs environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2531,10 +3067,13 @@ steps: - make initramfs environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2549,10 +3088,13 @@ steps: - make installer environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2567,10 +3109,13 @@ steps: - make container environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2585,14 +3130,19 @@ steps: - make lint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: protolint pull: always @@ -2601,14 +3151,19 @@ steps: - make protolint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: markdownlint pull: always @@ -2617,14 +3172,19 @@ steps: - make markdownlint environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp path: /tmp + depends_on: + - buildx - name: image-test pull: always @@ -2633,10 +3193,13 @@ steps: - make image-test environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2651,10 +3214,13 @@ steps: - make unit-tests environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2669,10 +3235,13 @@ steps: - make unit-tests-race environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2700,10 +3269,13 @@ steps: - make basic-integration environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2728,6 +3300,10 @@ steps: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2747,10 +3323,13 @@ steps: - make kernel environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2763,10 +3342,13 @@ steps: - make image-aws environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2781,10 +3363,13 @@ steps: - make image-azure environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2799,10 +3384,13 @@ steps: - make image-digital-ocean environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2817,10 +3405,13 @@ steps: - make image-gcp environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2835,10 +3426,13 @@ steps: - make image-vmware environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2853,10 +3447,13 @@ steps: - make iso environment: BINDIR: /usr/local/bin - BUILDKIT_HOST: ${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234} volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2900,6 +3497,10 @@ services: volumes: - name: dockersock path: /var/run + - name: docker + path: /root/.docker/buildx + - name: kube + path: /root/.kube - name: dev path: /dev - name: tmp @@ -2908,6 +3509,10 @@ services: volumes: - name: dockersock temp: {} +- name: docker + temp: {} +- name: kube + temp: {} - name: dev host: path: /dev @@ -2946,6 +3551,10 @@ services: volumes: - name: dockersock temp: {} +- name: docker + temp: {} +- name: kube + temp: {} - name: dev host: path: /dev diff --git a/Makefile b/Makefile index d18f1b38d..72b4544a0 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,9 @@ TOOLS ?= autonomy/tools:8fdb32d -# TODO(andrewrynhard): Move this logic to a shell script. -BUILDKIT_VERSION ?= v0.6.0 KUBECTL_VERSION ?= v1.17.0 GO_VERSION ?= 1.13 -BUILDKIT_IMAGE ?= moby/buildkit:$(BUILDKIT_VERSION) -BUILDKIT_HOST ?= tcp://0.0.0.0:1234 -BUILDKIT_CONTAINER_NAME ?= talos-buildkit -BUILDKIT_CONTAINER_STOPPED := $(shell docker ps --filter name=$(BUILDKIT_CONTAINER_NAME) --filter status=exited --format='{{.Names}}' 2>/dev/null) -BUILDKIT_CONTAINER_RUNNING := $(shell docker ps --filter name=$(BUILDKIT_CONTAINER_NAME) --filter status=running --format='{{.Names}}' 2>/dev/null) UNAME_S := $(shell uname -s) -ifeq ($(UNAME_S),Linux) -BUILDCTL_ARCHIVE := https://github.com/moby/buildkit/releases/download/$(BUILDKIT_VERSION)/buildkit-$(BUILDKIT_VERSION).linux-amd64.tar.gz -endif -ifeq ($(UNAME_S),Darwin) -BUILDCTL_ARCHIVE := https://github.com/moby/buildkit/releases/download/$(BUILDKIT_VERSION)/buildkit-$(BUILDKIT_VERSION).darwin-amd64.tar.gz -endif ifeq ($(UNAME_S),Linux) KUBECTL_ARCHIVE := https://storage.googleapis.com/kubernetes-release/release/$(KUBECTL_VERSION)/bin/linux/amd64/kubectl @@ -42,21 +29,28 @@ OSCTL_COMMAND := build/osctl-darwin-amd64 endif BINDIR ?= ./bin -CONFORM_VERSION ?= 57c9dbd +REGISTRY ?= docker.io +USERNAME ?= autonomy SHA ?= $(shell $(BINDIR)/gitmeta git sha) TAG ?= $(shell $(BINDIR)/gitmeta image tag) BRANCH ?= $(shell $(BINDIR)/gitmeta git branch) +REGISTRY_AND_USERNAME := $(REGISTRY)/$(USERNAME) -COMMON_ARGS = --progress=plain -COMMON_ARGS += --frontend=dockerfile.v0 -COMMON_ARGS += --allow security.insecure -COMMON_ARGS += --local context=. -COMMON_ARGS += --local dockerfile=. -COMMON_ARGS += --opt build-arg:TOOLS=$(TOOLS) -COMMON_ARGS += --opt build-arg:SHA=$(SHA) -COMMON_ARGS += --opt build-arg:TAG=$(TAG) -COMMON_ARGS += --opt build-arg:GO_VERSION=$(GO_VERSION) +PLATFORM ?= linux/amd64 +PROGRESS ?= auto +PUSH ?= false + +BUILD := docker buildx build +COMMON_ARGS := --file=Dockerfile +COMMON_ARGS += --progress=$(PROGRESS) +COMMON_ARGS += --platform=$(PLATFORM) +COMMON_ARGS += --push=$(PUSH) +COMMON_ARGS += --build-arg=TOOLS=$(TOOLS) +COMMON_ARGS += --build-arg=SHA=$(SHA) +COMMON_ARGS += --build-arg=TAG=$(TAG) +COMMON_ARGS += --build-arg=GO_VERSION=$(GO_VERSION) +COMMON_ARGS += . DOCKER_ARGS ?= @@ -65,10 +59,10 @@ TESTPKGS ?= ./... all: ci rootfs initramfs kernel osctl-linux osctl-darwin installer container .PHONY: ci -ci: builddeps buildkitd +ci: builddeps .PHONY: builddeps -builddeps: gitmeta buildctl +builddeps: gitmeta gitmeta: $(BINDIR)/gitmeta @@ -77,12 +71,6 @@ $(BINDIR)/gitmeta: @curl -L $(GITMETA) -o $(BINDIR)/gitmeta @chmod +x $(BINDIR)/gitmeta -buildctl: $(BINDIR)/buildctl - -$(BINDIR)/buildctl: - @mkdir -p $(BINDIR) - @curl -L $(BUILDCTL_ARCHIVE) | tar -zxf - -C $(BINDIR) --strip-components 1 bin/buildctl - kubectl: $(BINDIR)/kubectl $(BINDIR)/kubectl: @@ -90,91 +78,61 @@ $(BINDIR)/kubectl: @curl -L -o $(BINDIR)/kubectl $(KUBECTL_ARCHIVE) @chmod +x $(BINDIR)/kubectl -.PHONY: buildkitd -buildkitd: -ifeq (tcp://0.0.0.0:1234,$(findstring tcp://0.0.0.0:1234,$(BUILDKIT_HOST))) -ifeq ($(BUILDKIT_CONTAINER_STOPPED),$(BUILDKIT_CONTAINER_NAME)) - @echo "Removing exited talos-buildkit container" - @docker rm $(BUILDKIT_CONTAINER_NAME) -endif -ifneq ($(BUILDKIT_CONTAINER_RUNNING),$(BUILDKIT_CONTAINER_NAME)) - @echo "Starting talos-buildkit container" - @docker run \ - --name $(BUILDKIT_CONTAINER_NAME) \ - -d \ - --privileged \ - -p 1234:1234 \ - $(BUILDKIT_IMAGE) \ - --addr $(BUILDKIT_HOST) \ - --allow-insecure-entitlement security.insecure - @echo "Wait for buildkitd to become available" - @sleep 5 -endif -endif - -base: buildkitd - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --output type=docker,dest=build/$@.tar,name=docker.io/autonomy/$@:$(TAG) \ - --opt target=$@ \ +base: + @$(BUILD) \ + --output type=docker,dest=build/$@.tar,name=$(REGISTRY_AND_USERNAME)/$@:$(TAG) \ + --target=$@ \ $(COMMON_ARGS) .PHONY: generate -generate: buildkitd - $(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ +generate: + $(BUILD) \ --output type=local,dest=./ \ - --opt target=$@ \ + --target=$@ \ $(COMMON_ARGS) .PHONY: docs -docs: buildkitd $(OSCTL_DEFAULT_TARGET) - $(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ +docs: $(OSCTL_DEFAULT_TARGET) + $(BUILD) \ --output type=local,dest=./ \ - --opt target=$@ \ + --target=$@ \ $(COMMON_ARGS) @env HOME=/home/user $(OSCTL_COMMAND) docs docs/osctl .PHONY: kernel -kernel: buildkitd - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ +kernel: + @$(BUILD) \ --output type=local,dest=build \ - --opt target=$@ \ + --target=$@ \ $(COMMON_ARGS) @-rm -rf ./build/modules .PHONY: initramfs -initramfs: buildkitd - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ +initramfs: + @$(BUILD) \ --output type=local,dest=build \ - --opt target=$@ \ + --target=$@ \ $(COMMON_ARGS) .PHONY: squashfs -squashfs: buildkitd osd trustd ntpd networkd apid - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ +squashfs: osd trustd ntpd networkd apid + @$(BUILD) \ --output type=local,dest=build \ - --opt target=$@ \ + --target=$@ \ $(COMMON_ARGS) .PHONY: rootfs -rootfs: buildkitd osd trustd ntpd networkd apid - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --opt target=$@ \ +rootfs: osd trustd ntpd networkd apid + @$(BUILD) \ + --target=$@ \ $(COMMON_ARGS) .PHONY: installer -installer: buildkitd +installer: @mkdir -p build - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --output type=docker,dest=build/$@.tar,name=docker.io/autonomy/$@:$(TAG) \ - --opt target=$@ \ + @$(BUILD) \ + --output type=docker,dest=build/$@.tar,name=$(REGISTRY_AND_USERNAME)/$@:$(TAG) \ + --target=$@ \ $(COMMON_ARGS) @docker load < build/$@.tar @@ -281,11 +239,10 @@ iso: @docker run --rm -i -v $(PWD)/build:/out autonomy/installer:$(TAG) iso .PHONY: container -container: buildkitd - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --output type=docker,dest=build/$@.tar,name=docker.io/autonomy/talos:$(TAG) \ - --opt target=$@ \ +container: + @$(BUILD) \ + --output type=docker,dest=build/$@.tar,name=$(REGISTRY_AND_USERNAME)/talos:$(TAG) \ + --target=$@ \ $(COMMON_ARGS) @docker load < build/$@.tar @@ -302,28 +259,26 @@ e2e-integration: @TAG=$(TAG) SHA=$(SHA) ./hack/test/$@.sh .PHONY: unit-tests -unit-tests: buildkitd - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --opt target=$@ \ +unit-tests: + @$(BUILD) \ + --target=$@ \ --output type=local,dest=./ \ - --opt build-arg:TESTPKGS=$(TESTPKGS) \ + --build-arg=TESTPKGS=$(TESTPKGS) \ + --allow security.insecure \ $(COMMON_ARGS) .PHONY: unit-tests-race -unit-tests-race: buildkitd - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --opt target=$@ \ - --opt build-arg:TESTPKGS=$(TESTPKGS) \ +unit-tests-race: + @$(BUILD) \ + --target=$@ \ + --build-arg=TESTPKGS=$(TESTPKGS) \ $(COMMON_ARGS) .PHONY: integration-test -integration-test: buildkitd - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ +integration-test: + @$(BUILD) \ --output type=local,dest=bin \ - --opt target=$@ \ + --target=$@ \ $(COMMON_ARGS) .PHONY: fmt @@ -331,87 +286,76 @@ fmt: @docker run --rm -it -v $(PWD):/src -w /src golang:$(GO_VERSION) bash -c "export GO111MODULE=on; export GOPROXY=https://proxy.golang.org; cd /tmp && go mod init tmp && go get mvdan.cc/gofumpt/gofumports && cd - && gofumports -w -local github.com/talos-systems/talos ." .PHONY: lint -lint: buildkitd - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --opt target=$@ \ +lint: + @$(BUILD) \ + --target=$@ \ $(COMMON_ARGS) .PHONY: protolint -protolint: buildkitd - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --opt target=$@ \ +protolint: + @$(BUILD) \ + --target=$@ \ $(COMMON_ARGS) .PHONY: markdownlint -markdownlint: buildkitd - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --opt target=$@ \ +markdownlint: + @$(BUILD) \ + --target=$@ \ $(COMMON_ARGS) .PHONY: osctl-linux -osctl-linux: buildkitd - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ +osctl-linux: + @$(BUILD) \ --output type=local,dest=build \ - --opt target=$@ \ + --target=$@ \ $(COMMON_ARGS) .PHONY: osctl-darwin -osctl-darwin: buildkitd - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ +osctl-darwin: + @$(BUILD) \ --output type=local,dest=build \ - --opt target=$@ \ + --target=$@ \ $(COMMON_ARGS) .PHONY: machined -machined: buildkitd images - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --opt target=$@ \ +machined: images + @$(BUILD) \ + --target=$@ \ $(COMMON_ARGS) .PHONY: osd -osd: buildkitd images - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --output type=docker,dest=images/$@.tar,name=docker.io/autonomy/$@:$(TAG) \ - --opt target=$@ \ +osd: images + @$(BUILD) \ + --output type=docker,dest=images/$@.tar,name=$(REGISTRY_AND_USERNAME)/$@:$(TAG) \ + --target=$@ \ $(COMMON_ARGS) .PHONY: apid -apid: buildkitd images - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --output type=docker,dest=images/$@.tar,name=docker.io/autonomy/$@:$(TAG) \ - --opt target=$@ \ +apid: images + @$(BUILD) \ + --output type=docker,dest=images/$@.tar,name=$(REGISTRY_AND_USERNAME)/$@:$(TAG) \ + --target=$@ \ $(COMMON_ARGS) .PHONY: trustd -trustd: buildkitd images - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --output type=docker,dest=images/$@.tar,name=docker.io/autonomy/$@:$(TAG) \ - --opt target=$@ \ +trustd: images + @$(BUILD) \ + --output type=docker,dest=images/$@.tar,name=$(REGISTRY_AND_USERNAME)/$@:$(TAG) \ + --target=$@ \ $(COMMON_ARGS) .PHONY: ntpd -ntpd: buildkitd images - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --output type=docker,dest=images/$@.tar,name=docker.io/autonomy/$@:$(TAG) \ - --opt target=$@ \ +ntpd: images + @$(BUILD) \ + --output type=docker,dest=images/$@.tar,name=$(REGISTRY_AND_USERNAME)/$@:$(TAG) \ + --target=$@ \ $(COMMON_ARGS) .PHONY: networkd -networkd: buildkitd images - @$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \ - build \ - --output type=docker,dest=images/$@.tar,name=docker.io/autonomy/$@:$(TAG) \ - --opt target=$@ \ +networkd: images + @$(BUILD) \ + --output type=docker,dest=images/$@.tar,name=$(REGISTRY_AND_USERNAME)/$@:$(TAG) \ + --target=$@ \ $(COMMON_ARGS) images: diff --git a/hack/drone.jsonnet b/hack/drone.jsonnet index 213a38315..06956ad35 100644 --- a/hack/drone.jsonnet +++ b/hack/drone.jsonnet @@ -6,6 +6,15 @@ local build_container = 'autonomy/build-container:latest'; +local secret = { + kind: 'secret', + name: 'kubeconfig', + get: { + path: 'buildx', + name: 'kubeconfig' + }, +}; + local volumes = { dockersock: { pipeline: { @@ -18,6 +27,28 @@ local volumes = { }, }, + docker: { + pipeline: { + name: 'docker', + temp: {}, + }, + step: { + name: $.docker.pipeline.name, + path: '/root/.docker/buildx', + }, + }, + + kube: { + pipeline: { + name: 'kube', + temp: {}, + }, + step: { + name: $.kube.pipeline.name, + path: '/root/.kube', + }, + }, + dev: { pipeline: { name: 'dev', @@ -44,12 +75,16 @@ local volumes = { ForStep(): [ self.dockersock.step, + self.docker.step, + self.kube.step, self.dev.step, self.tmp.step, ], ForPipeline(): [ self.dockersock.pipeline, + self.docker.pipeline, + self.kube.pipeline, self.dev.pipeline, self.tmp.pipeline, ], @@ -70,18 +105,21 @@ local docker = { volumes: volumes.ForStep(), }; -// This step is used only when `drone exec` is executed. -local buildkit = { - name: 'buildkit', - image: 'moby/buildkit:v0.6.0', +// Sets up the buildx backend +local buildx = { + name: 'buildx', + image: 'autonomy/build-container:latest', privileged: true, - detach: true, - commands: ['buildkitd --addr tcp://0.0.0.0:1234 --allow-insecure-entitlement security.insecure'], - when: { - event: { - include: [''], - }, + environment: { + BUILDX_KUBECONFIG: { from_secret: secret.name }, }, + commands: [ + "apk add coreutils", + 'echo -e "$BUILDX_KUBECONFIG" > /root/.kube/config', + 'docker buildx create --driver kubernetes --driver-opt replicas=2 --driver-opt namespace=ci --driver-opt image=moby/buildkit:v0.6.2 --name ci --buildkitd-flags="--allow-insecure-entitlement security.insecure" --use', + 'docker buildx inspect --bootstrap' + ], + volumes: volumes.ForStep(), }; // Step standardizes the creation of build steps. The name of the step is used @@ -94,7 +132,6 @@ local Step(name, image='', target='', depends_on=[], environment={}) = { local make = if target == '' then std.format('make %s', name) else std.format('make %s', target), local common_env_vars = { - BUILDKIT_HOST: '${BUILDKIT_HOST=tcp://buildkitd.ci.svc:1234}', BINDIR: '/usr/local/bin', }, @@ -109,7 +146,7 @@ local Step(name, image='', target='', depends_on=[], environment={}) = { // Pipeline is a way to standardize the creation of pipelines. It supports // using and existing pipeline as a base. -local Pipeline(name, steps=[], depends_on=[], with_buildkit=false, with_docker=true, disable_clone=false) = { +local Pipeline(name, steps=[], depends_on=[], with_docker=true, disable_clone=false) = { local node = { 'node-role.kubernetes.io/ci': '' }, kind: 'pipeline', @@ -117,7 +154,6 @@ local Pipeline(name, steps=[], depends_on=[], with_buildkit=false, with_docker=t node: node, services: [ if with_docker then docker, - if with_buildkit then buildkit, ], [ if disable_clone then 'clone']: { disable: true, @@ -136,22 +172,22 @@ local fetchtags = { ], }; -local machined = Step("machined", depends_on=[fetchtags]); -local osd = Step("osd", depends_on=[fetchtags]); -local trustd = Step("trustd", depends_on=[fetchtags]); -local ntpd = Step("ntpd", depends_on=[fetchtags]); -local networkd = Step("networkd", depends_on=[fetchtags]); -local apid = Step("apid", depends_on=[fetchtags]); -local osctl_linux = Step("osctl-linux", depends_on=[fetchtags]); -local osctl_darwin = Step("osctl-darwin", depends_on=[fetchtags]); -local integration_test = Step("integration-test", depends_on=[fetchtags]); +local machined = Step("machined", depends_on=[buildx]); +local osd = Step("osd", depends_on=[buildx]); +local trustd = Step("trustd", depends_on=[buildx]); +local ntpd = Step("ntpd", depends_on=[buildx]); +local networkd = Step("networkd", depends_on=[buildx]); +local apid = Step("apid", depends_on=[buildx]); +local osctl_linux = Step("osctl-linux", depends_on=[buildx]); +local osctl_darwin = Step("osctl-darwin", depends_on=[buildx]); +local integration_test = Step("integration-test", depends_on=[buildx]); local rootfs = Step("rootfs", depends_on=[machined, osd, trustd, ntpd, networkd, apid]); local initramfs = Step("initramfs", depends_on=[rootfs]); local installer = Step("installer", depends_on=[rootfs]); local container = Step("container", depends_on=[rootfs]); -local lint = Step("lint"); -local protolint = Step("protolint"); -local markdownlint = Step("markdownlint"); +local lint = Step("lint", depends_on=[buildx]); +local protolint = Step("protolint", depends_on=[buildx]); +local markdownlint = Step("markdownlint", depends_on=[buildx]); local image_test = Step("image-test", depends_on=[installer]); local unit_tests = Step("unit-tests", depends_on=[rootfs]); local unit_tests_race = Step("unit-tests-race", depends_on=[lint]); @@ -193,6 +229,7 @@ local push_latest = { local default_steps = [ fetchtags, + buildx, machined, osd, apid, @@ -438,11 +475,12 @@ local notify_depends_on = { ], }; -local notify_pipeline = Pipeline('notify', notify_steps, [default_pipeline, e2e_pipeline, conformance_pipeline, nightly_pipeline, release_pipeline], false, false, true) + notify_trigger; +local notify_pipeline = Pipeline('notify', notify_steps, [default_pipeline, e2e_pipeline, conformance_pipeline, nightly_pipeline, release_pipeline], false, true) + notify_trigger; // Final configuration file definition. [ + secret, default_pipeline, e2e_pipeline, conformance_pipeline,