From 6d2d57eaac302df4b83f917d52dd768a06f1c016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Ro=C5=A1kar?= Date: Fri, 22 Jul 2022 12:08:06 +0200 Subject: [PATCH] chore: update build steps for buildx --- .../workflows/build-and-push-to-docker.yml | 58 ++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-push-to-docker.yml b/.github/workflows/build-and-push-to-docker.yml index cf4912c2..cf832e39 100644 --- a/.github/workflows/build-and-push-to-docker.yml +++ b/.github/workflows/build-and-push-to-docker.yml @@ -93,6 +93,7 @@ jobs: export RENKU_PYTHON_BASE_IMAGE_TAG=${{ matrix.BASE_IMAGE_TAG }} fi +<<<<<<< HEAD:.github/workflows/build-and-push-to-docker.yml # needed by the makefile - these are generated dynamically # and hence they are not part of the env setup above export BASE_IMAGE_TAG=${{ matrix.BASE_IMAGE_TAG }} @@ -101,6 +102,13 @@ jobs: make py echo "IMAGE_NAME=${DOCKER_PREFIX}-py:${PY_DOCKER_LABEL}" >> $GITHUB_OUTPUT +======= + docker build \ + --tag $DOCKER_NAME-py:$LABEL_PREFIX-$LABEL \ + --build-arg BASE_IMAGE="jupyter/base-notebook:${{ matrix.BASE_IMAGE_TAG }}" \ + docker/py + echo "::set-output name=IMAGE_NAME::$DOCKER_NAME-py:$LABEL_PREFIX-$LABEL" +>>>>>>> 8b205b6 (chore: update build steps for buildx):.github/workflows/build_and_push_to_docker.yml - name: Image Acceptance Tests uses: cypress-io/github-action@v4 env: @@ -113,10 +121,16 @@ jobs: - name: Push to docker run: | - docker push ${{ steps.build-image.outputs.IMAGE_NAME }} + docker buildx build \ + --platform ${{env.DOCKER_PLATFORMS}} \ + --tag ${{ steps.build-image.outputs.IMAGE_NAME }} \ + --build-arg BASE_IMAGE="jupyter/base-notebook:${{ matrix.BASE_IMAGE_TAG }}" \ + --push \ + docker/py # on master push latest image - the lab-* image is tagged latest if [ "$REF" == "refs/heads/master" ] && [ "${{ matrix.BASE_IMAGE_TAG }}" == lab-* ]; then +<<<<<<< HEAD:.github/workflows/build-and-push-to-docker.yml docker tag ${{ steps.build-image.outputs.IMAGE_NAME }} $DOCKER_PREFIX-py:latest docker push $DOCKER_PREFIX-py:latest fi @@ -203,6 +217,17 @@ jobs: if [ "$REF" == "refs/heads/master" ] && [ "${{ matrix.CUDA_VERSION }}" == "11.7" ]; then docker tag ${{ steps.build-image.outputs.IMAGE_NAME }} $DOCKER_PREFIX-cuda:latest docker push $DOCKER_PREFIX-cuda:latest +======= + docker buildx build \ + --platform ${{env.DOCKER_PLATFORMS}} \ + --tag $DOCKER_NAME-py:latest \ + --build-arg BASE_IMAGE="jupyter/base-notebook:${{ matrix.BASE_IMAGE_TAG }}" \ + --push \ + docker/py + + docker tag ${{ steps.build-image.outputs.IMAGE_NAME }} $DOCKER_NAME-py:latest + docker push $DOCKER_NAME-py:latest +>>>>>>> 8b205b6 (chore: update build steps for buildx):.github/workflows/build_and_push_to_docker.yml fi build-py-ext: @@ -264,6 +289,20 @@ jobs: - uses: actions/checkout@v3 - name: Build renku project python-based docker image extensions +<<<<<<< HEAD:.github/workflows/build-and-push-to-docker.yml +======= + run: | + if [[ ${{ github.ref }} == refs/tags* ]]; then + export LABEL=$(echo ${{ github.ref }} | cut -d / -f 3) + else + export LABEL=$(echo ${{ github.sha }} | cut -c 1-7) + fi + + docker buildx build docker/$EXTENSION \ + --build-arg BASE_IMAGE="$DOCKER_NAME-vnc:$LABEL" \ + --tag $DOCKER_NAME-$EXTENSION:$LABEL \ + --push +>>>>>>> 8b205b6 (chore: update build steps for buildx):.github/workflows/build_and_push_to_docker.yml env: EXTENSION: ${{ matrix.VNC-EXTENSIONS }} <<<<<<< HEAD:.github/workflows/build-and-push-to-docker.yml @@ -334,6 +373,7 @@ jobs: fi docker pull ${DOCKER_PREFIX}-py:${DEFAULT_PYTHON_VERSION}-${LABEL} +<<<<<<< HEAD:.github/workflows/build-and-push-to-docker.yml # needed by the makefile export JULIA_DOCKER_LABEL="${{ matrix.JULIAVERSIONS }}-$LABEL" export GIT_COMMIT_SHA=$(git rev-parse --short=7 --verify HEAD) @@ -341,6 +381,14 @@ jobs: make julia echo "IMAGE_NAME=$DOCKER_PREFIX-julia:$JULIA_DOCKER_LABEL" >> $GITHUB_OUTPUT +======= + export DOCKER_TAG="${{ matrix.JULIAVERSIONS }}-$LABEL" + docker build \ + --build-arg BASE_IMAGE="$DOCKER_NAME-py:3.9-$LABEL" \ + --tag $DOCKER_NAME-julia:$DOCKER_TAG \ + docker/julia + echo "::set-output name=IMAGE_NAME::$DOCKER_NAME-julia:$DOCKER_TAG" +>>>>>>> 8b205b6 (chore: update build steps for buildx):.github/workflows/build_and_push_to_docker.yml - name: Image Acceptance Tests uses: cypress-io/github-action@v4 env: @@ -352,8 +400,16 @@ jobs: command: npx mocha -r ts-node/register index.ts - name: Push to docker run: | +<<<<<<< HEAD:.github/workflows/build-and-push-to-docker.yml docker push ${{ steps.build-image.outputs.IMAGE_NAME }} +======= + docker buildx build --platform ${{env.DOCKER_PLATFORMS}} docker/julia \ + --build-arg BASE_IMAGE="$DOCKER_NAME-py:3.9-$LABEL" \ + --tag ${{ steps.build-image.outputs.IMAGE_NAME }} \ + --push + +>>>>>>> 8b205b6 (chore: update build steps for buildx):.github/workflows/build_and_push_to_docker.yml build-r-ubuntu: needs: build-py runs-on: ubuntu-latest