Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use semaphore self-hosted arm64 machine #8558

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 40 additions & 31 deletions .semaphore/push-images/alp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,48 @@ agent:
execution_time_limit:
minutes: 60

global_job_config:
env_vars:
- name: DEV_REGISTRIES
value: quay.io/calico docker.io/calico
secrets:
- name: docker
- name: quay-robot-calico+semaphoreci
prologue:
commands:
- checkout
# Semaphore mounts a copy-on-write FS as /var/lib/docker in order to provide a pre-loaded cache of
# some images. However, the cache is not useful to us and the copy-on-write FS is a big problem given
# how much we churn docker containers during the build. Disable it.
- sudo systemctl stop docker
- sudo umount /var/lib/docker && sudo killall qemu-nbd || true
- sudo systemctl start docker
# Free up space on the build machine.
- sudo rm -rf ~/{.kerl,.kiex,.npm,.nvm,.phpbrew,.rbenv,.sbt} /opt/{apache-maven*,firefox*,scala} /usr/lib/jvm /usr/local/{aws2,golang,phantomjs*}
# Semaphore is doing shallow clone on a commit without tags.
# unshallow it for GIT_VERSION:=$(shell git describe --tags --dirty --always)
- retry git fetch --unshallow
- echo $DOCKER_TOKEN | docker login --username "$DOCKER_USER" --password-stdin
- echo $QUAY_TOKEN | docker login --username "$QUAY_USER" --password-stdin quay.io
- export BRANCH_NAME=$SEMAPHORE_GIT_BRANCH

blocks:
# Build and push images.
# We'll only do this on non-PR builds, where we have credentials to do so.
- name: "Publish ALP images"
- name: Publish ALP images
dependencies: []
skip:
when: "branch !~ '.+'"
task:
jobs:
- name: Linux multi-arch
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C app-policy cd CONFIRM=true; fi
- name: Publish ALP multi-arch manifests
dependencies:
- Publish ALP images
skip:
# Only run on branches, not PRs.
when: "branch !~ '.+'"
task:
prologue:
commands:
- checkout
# Semaphore mounts a copy-on-write FS as /var/lib/docker in order to provide a pre-loaded cache of
# some images. However, the cache is not useful to us and the copy-on-write FS is a big problem given
# how much we churn docker containers during the build. Disable it.
- sudo systemctl stop docker
- sudo umount /var/lib/docker && sudo killall qemu-nbd || true
- sudo systemctl start docker
# Free up space on the build machine.
- sudo rm -rf ~/.kiex ~/.phpbrew ~/.rbenv ~/.nvm ~/.kerl ~/.sbt ~/.npm /usr/lib/jvm /opt/firefox* /opt/apache-maven* /opt/scala /usr/local/golang
# Semaphore is doing shallow clone on a commit without tags.
# unshallow it for GIT_VERSION:=$(shell git describe --tags --dirty --always)
- retry git fetch --unshallow
- echo $DOCKER_TOKEN | docker login --username "$DOCKER_USER" --password-stdin
- echo $QUAY_TOKEN | docker login --username "$QUAY_USER" --password-stdin quay.io
- export BRANCH_NAME=$SEMAPHORE_GIT_BRANCH
secrets:
- name: quay-robot-calico+semaphoreci
- name: docker
jobs:
- name: "ALP"
env_vars:
- name: DEV_REGISTRIES
value: quay.io/calico docker.io/calico
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C pod2daemon image-all cd CONFIRM=true; fi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pod2daemon is moved to its own push image yaml file.

- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C app-policy image-all cd CONFIRM=true; fi
- name: Linux multi-arch manifests
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C app-policy push-manifests-with-tag CONFIRM=true; fi
72 changes: 40 additions & 32 deletions .semaphore/push-images/apiserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,48 @@ agent:
execution_time_limit:
minutes: 60

global_job_config:
env_vars:
- name: DEV_REGISTRIES
value: quay.io/calico docker.io/calico
secrets:
- name: docker
- name: quay-robot-calico+semaphoreci
prologue:
commands:
- checkout
# Semaphore mounts a copy-on-write FS as /var/lib/docker in order to provide a pre-loaded cache of
# some images. However, the cache is not useful to us and the copy-on-write FS is a big problem given
# how much we churn docker containers during the build. Disable it.
- sudo systemctl stop docker
- sudo umount /var/lib/docker && sudo killall qemu-nbd || true
- sudo systemctl start docker
# Free up space on the build machine.
- sudo rm -rf ~/{.kerl,.kiex,.npm,.nvm,.phpbrew,.rbenv,.sbt} /opt/{apache-maven*,firefox*,scala} /usr/lib/jvm /usr/local/{aws2,golang,phantomjs*}
# Semaphore is doing shallow clone on a commit without tags.
# unshallow it for GIT_VERSION:=$(shell git describe --tags --dirty --always)
- retry git fetch --unshallow
- echo $DOCKER_TOKEN | docker login --username "$DOCKER_USER" --password-stdin
- echo $QUAY_TOKEN | docker login --username "$QUAY_USER" --password-stdin quay.io
- export BRANCH_NAME=$SEMAPHORE_GIT_BRANCH

blocks:
# Build and push images.
# We'll only do this on non-PR builds, where we have credentials to do so.
- name: "Publish apiserver images"
- name: Publish apiserver images
dependencies: []
skip:
when: "branch !~ '.+'"
task:
jobs:
- name: Linux multi-arch
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C apiserver cd CONFIRM=true; fi
- name: Publish apiserver multi-arch manifests
dependencies:
- Publish apiserver images
skip:
# Only run on branches, not PRs.
when: "branch !~ '.+'"
task:
prologue:
commands:
- checkout
# Semaphore mounts a copy-on-write FS as /var/lib/docker in order to provide a pre-loaded cache of
# some images. However, the cache is not useful to us and the copy-on-write FS is a big problem given
# how much we churn docker containers during the build. Disable it.
- sudo systemctl stop docker
- sudo umount /var/lib/docker && sudo killall qemu-nbd || true
- sudo systemctl start docker
# Free up space on the build machine.
- sudo rm -rf ~/.kiex ~/.phpbrew ~/.rbenv ~/.nvm ~/.kerl ~/.sbt ~/.npm /usr/lib/jvm /opt/firefox* /opt/apache-maven* /opt/scala /usr/local/golang
# Semaphore is doing shallow clone on a commit without tags.
# unshallow it for GIT_VERSION:=$(shell git describe --tags --dirty --always)
- retry git fetch --unshallow
- echo $DOCKER_TOKEN | docker login --username "$DOCKER_USER" --password-stdin
- echo $QUAY_TOKEN | docker login --username "$QUAY_USER" --password-stdin quay.io
- export BRANCH_NAME=$SEMAPHORE_GIT_BRANCH
secrets:
- name: quay-robot-calico+semaphoreci
- name: docker
jobs:
# The apiserver build takes a long time due to some architectures, so we split it up.
# TODO: Add support for other architectures
- name: "Linux amd64"
env_vars:
- name: DEV_REGISTRIES
value: quay.io/calico docker.io/calico
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make VALIDARCHES=amd64 -C apiserver image-all cd-common CONFIRM=true; fi
- name: Linux multi-arch manifests
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C apiserver push-manifests-with-tag CONFIRM=true; fi
72 changes: 41 additions & 31 deletions .semaphore/push-images/calicoctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,54 @@ version: v1.0
name: Publish calicoctl images
agent:
machine:
type: e1-standard-4
type: e1-standard-2
os_image: ubuntu2004

execution_time_limit:
minutes: 60

global_job_config:
env_vars:
- name: DEV_REGISTRIES
value: quay.io/calico docker.io/calico
secrets:
- name: docker
- name: quay-robot-calico+semaphoreci
prologue:
commands:
- checkout
# Semaphore mounts a copy-on-write FS as /var/lib/docker in order to provide a pre-loaded cache of
# some images. However, the cache is not useful to us and the copy-on-write FS is a big problem given
# how much we churn docker containers during the build. Disable it.
- sudo systemctl stop docker
- sudo umount /var/lib/docker && sudo killall qemu-nbd || true
- sudo systemctl start docker
# Free up space on the build machine.
- sudo rm -rf ~/{.kerl,.kiex,.npm,.nvm,.phpbrew,.rbenv,.sbt} /opt/{apache-maven*,firefox*,scala} /usr/lib/jvm /usr/local/{aws2,golang,phantomjs*}
# Semaphore is doing shallow clone on a commit without tags.
# unshallow it for GIT_VERSION:=$(shell git describe --tags --dirty --always)
- retry git fetch --unshallow
- echo $DOCKER_TOKEN | docker login --username "$DOCKER_USER" --password-stdin
- echo $QUAY_TOKEN | docker login --username "$QUAY_USER" --password-stdin quay.io
- export BRANCH_NAME=$SEMAPHORE_GIT_BRANCH

blocks:
# Build and push images.
# We'll only do this on non-PR builds, where we have credentials to do so.
- name: "Publish calicoctl images"
- name: Publish calicoctl images
dependencies: []
skip:
when: "branch !~ '.+'"
task:
jobs:
- name: Linux multi-arch
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C calicoctl cd CONFIRM=true; fi
- name: Publish calicoctl multi-arch manifests
dependencies:
- Publish calicoctl images
skip:
# Only run on branches, not PRs.
when: "branch !~ '.+'"
task:
prologue:
commands:
- checkout
# Semaphore mounts a copy-on-write FS as /var/lib/docker in order to provide a pre-loaded cache of
# some images. However, the cache is not useful to us and the copy-on-write FS is a big problem given
# how much we churn docker containers during the build. Disable it.
- sudo systemctl stop docker
- sudo umount /var/lib/docker && sudo killall qemu-nbd || true
- sudo systemctl start docker
# Free up space on the build machine.
- sudo rm -rf ~/.kiex ~/.phpbrew ~/.rbenv ~/.nvm ~/.kerl ~/.sbt ~/.npm /usr/lib/jvm /opt/firefox* /opt/apache-maven* /opt/scala /usr/local/golang
# Semaphore is doing shallow clone on a commit without tags.
# unshallow it for GIT_VERSION:=$(shell git describe --tags --dirty --always)
- retry git fetch --unshallow
- echo $DOCKER_TOKEN | docker login --username "$DOCKER_USER" --password-stdin
- echo $QUAY_TOKEN | docker login --username "$QUAY_USER" --password-stdin quay.io
- export BRANCH_NAME=$SEMAPHORE_GIT_BRANCH
secrets:
- name: quay-robot-calico+semaphoreci
- name: docker
jobs:
- name: "calicoctl"
env_vars:
- name: DEV_REGISTRIES
value: quay.io/calico docker.io/calico
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C calicoctl image-all cd CONFIRM=true; fi
- name: Linux multi-arch manifests
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C calicoctl push-manifests-with-tag CONFIRM=true; fi
79 changes: 43 additions & 36 deletions .semaphore/push-images/cni-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,51 @@ agent:
execution_time_limit:
minutes: 60

global_job_config:
env_vars:
- name: DEV_REGISTRIES
value: quay.io/calico docker.io/calico
secrets:
- name: docker
- name: quay-robot-calico+semaphoreci
prologue:
commands:
- checkout
# Semaphore mounts a copy-on-write FS as /var/lib/docker in order to provide a pre-loaded cache of
# some images. However, the cache is not useful to us and the copy-on-write FS is a big problem given
# how much we churn docker containers during the build. Disable it.
- sudo systemctl stop docker
- sudo umount /var/lib/docker && sudo killall qemu-nbd || true
- sudo systemctl start docker
# Free up space on the build machine.
- sudo rm -rf ~/{.kerl,.kiex,.npm,.nvm,.phpbrew,.rbenv,.sbt} /opt/{apache-maven*,firefox*,scala} /usr/lib/jvm /usr/local/{aws2,golang,phantomjs*}
# Semaphore is doing shallow clone on a commit without tags.
# unshallow it for GIT_VERSION:=$(shell git describe --tags --dirty --always)
- retry git fetch --unshallow
- echo $DOCKER_TOKEN | docker login --username "$DOCKER_USER" --password-stdin
- echo $QUAY_TOKEN | docker login --username "$QUAY_USER" --password-stdin quay.io
- export BRANCH_NAME=$SEMAPHORE_GIT_BRANCH

blocks:
# Build and push images.
# We'll only do this on non-PR builds, where we have credentials to do so.
- name: "Publish cni-plugin images"
- name: Publish cni-plugin images
dependencies: []
skip:
when: "branch !~ '.+'"
task:
jobs:
- name: Linux multi-arch
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C cni-plugin cd CONFIRM=true; fi
- name: Windows
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C cni-plugin release-windows CONFIRM=true; fi
- name: Publish cni-plugin multi-arch manifests
dependencies:
- Publish cni-plugin images
skip:
# Only run on branches, not PRs.
when: "branch !~ '.+'"
task:
prologue:
commands:
- checkout
# Semaphore mounts a copy-on-write FS as /var/lib/docker in order to provide a pre-loaded cache of
# some images. However, the cache is not useful to us and the copy-on-write FS is a big problem given
# how much we churn docker containers during the build. Disable it.
- sudo systemctl stop docker
- sudo umount /var/lib/docker && sudo killall qemu-nbd || true
- sudo systemctl start docker
# Free up space on the build machine.
- sudo rm -rf ~/.kiex ~/.phpbrew ~/.rbenv ~/.nvm ~/.kerl ~/.sbt ~/.npm /usr/lib/jvm /opt/firefox* /opt/apache-maven* /opt/scala /usr/local/golang
# Semaphore is doing shallow clone on a commit without tags.
# unshallow it for GIT_VERSION:=$(shell git describe --tags --dirty --always)
- retry git fetch --unshallow
- echo $DOCKER_TOKEN | docker login --username "$DOCKER_USER" --password-stdin
- echo $QUAY_TOKEN | docker login --username "$QUAY_USER" --password-stdin quay.io
- export BRANCH_NAME=$SEMAPHORE_GIT_BRANCH
secrets:
- name: quay-robot-calico+semaphoreci
- name: docker
jobs:
- name: "linux"
env_vars:
- name: DEV_REGISTRIES
value: quay.io/calico docker.io/calico
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C cni-plugin image-all cd CONFIRM=true; fi
- name: "windows"
env_vars:
- name: DEV_REGISTRIES
value: quay.io/calico docker.io/calico
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C cni-plugin release-windows CONFIRM=true; fi
- name: Linux multi-arch manifests
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C cni-plugin push-manifests-with-tag CONFIRM=true; fi
Loading