Publish ceph images #2282
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish ceph images | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - .github/workflows/main.yml | |
| - docker/ceph/aws/aws-cli-configure.sh | |
| - 'docker/ceph/**/Dockerfile' | |
| - docker/ceph/rpm/set-ceph-repo.sh | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - .github/workflows/main.yml | |
| - docker/ceph/aws/aws-cli-configure.sh | |
| - 'docker/ceph/**/Dockerfile' | |
| - docker/ceph/rpm/set-ceph-repo.sh | |
| schedule: | |
| - cron: '0 2 * * *' | |
| jobs: | |
| build-ceph-base: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| os: [centos_stream9] | |
| include: | |
| - os: centos_stream9 | |
| centos_version: 9 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 | |
| - name: Install QEMU for cross-arch emulation | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y binfmt-support qemu-user-static | |
| - name: Set up Docker Buildx | |
| run: | | |
| docker buildx create --name ceph_builder --use | |
| docker buildx inspect ceph_builder --bootstrap | |
| - name: Log in to DockerHub | |
| run: | | |
| echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
| - name: Build | |
| run: | | |
| docker buildx build \ | |
| --builder ceph_builder \ | |
| --platform linux/amd64,linux/arm64 \ | |
| --tag docker.io/rhcsdashboard/ceph-base:${{ matrix.os }} \ | |
| --push \ | |
| --file docker/ceph/centos/Dockerfile \ | |
| --build-arg CENTOS_VERSION=${{ matrix.centos_version }} \ | |
| ./docker/ceph | |
| - name: Docker Logout | |
| run: docker logout | |
| build-ceph: | |
| name: build-${{ matrix.name }}-${{ matrix.arch }}-on-${{ matrix.branch }} | |
| needs: build-ceph-base | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| branch: [main, tentacle, squid, reef, quincy, pacific] | |
| name: [ceph, ceph-rpm] | |
| arch: [amd64, arm64] | |
| include: | |
| - centos_version: 9 | |
| - name: ceph | |
| dir: ceph | |
| - name: ceph-rpm | |
| dir: ceph/rpm | |
| exclude: | |
| - name: ceph | |
| arch: arm64 | |
| - branch: pacific | |
| arch: arm64 | |
| - branch: quincy | |
| arch: arm64 | |
| - branch: reef | |
| arch: arm64 | |
| - branch: squid | |
| arch: arm64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 | |
| - name: Install QEMU for cross-arch emulation | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y binfmt-support qemu-user-static | |
| - name: Set up Docker Buildx | |
| run: | | |
| docker buildx create --name ceph_builder --use | |
| docker buildx inspect ceph_builder --bootstrap | |
| - name: Log in to DockerHub | |
| run: | | |
| echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
| - name: Build arch-specific images | |
| run: | | |
| docker buildx build \ | |
| --platform linux/${{ matrix.arch }} \ | |
| --tag docker.io/rhcsdashboard/${{ matrix.name }}:${{ matrix.branch }}-${{ matrix.arch }} \ | |
| --push \ | |
| --file docker/${{ matrix.dir }}/${{ matrix.branch_dir }}/Dockerfile \ | |
| --build-arg CEPH_RELEASE=${{ matrix.branch }} \ | |
| --build-arg VCS_BRANCH=${{ matrix.branch }} \ | |
| --build-arg CENTOS_VERSION=${{ matrix.centos_version }} \ | |
| --provenance=false \ | |
| --sbom=false \ | |
| ./docker/ceph | |
| - name: Docker Logout | |
| run: docker logout | |
| create-manifests: | |
| needs: build-ceph | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| branch: [main, tentacle, squid, reef, quincy, pacific] | |
| name: [ceph, ceph-rpm] | |
| steps: | |
| - name: Log in to DockerHub | |
| run: | | |
| echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
| - name: Create manifest and push | |
| run: | | |
| FINAL_TAG="docker.io/rhcsdashboard/${{ matrix.name }}:${{ matrix.branch }}" | |
| AMD_TAG="${FINAL_TAG}-amd64" | |
| ARM_TAG="${FINAL_TAG}-arm64" | |
| echo "Creating manifest for $FINAL_TAG" | |
| docker pull $AMD_TAG || true | |
| docker pull $ARM_TAG || true | |
| # check if arm tag exists before creating manifest | |
| if docker manifest inspect $ARM_TAG > /dev/null 2>&1; then | |
| docker manifest create $FINAL_TAG --amend $AMD_TAG --amend $ARM_TAG | |
| else | |
| docker manifest create $FINAL_TAG --amend $AMD_TAG | |
| fi | |
| docker manifest push $FINAL_TAG | |
| - name: Docker Logout | |
| run: docker logout | |
| build-ceph-e2e: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| branch: [main, tentacle, squid, reef, quincy, pacific] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@master | |
| - name: Build | |
| run: docker build -t docker.io/rhcsdashboard/ceph-e2e:${{ matrix.branch }} -f docker/ceph/e2e/Dockerfile ./docker/ceph --build-arg VCS_BRANCH=${{ matrix.branch }} | |
| - name: Push | |
| run: | | |
| echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | |
| docker push docker.io/rhcsdashboard/ceph-e2e:${{ matrix.branch }} | |
| docker logout | |
| - name: Docker Logout | |
| run: docker logout |