Skip to content

Commit

Permalink
chore: update build steps for buildx
Browse files Browse the repository at this point in the history
  • Loading branch information
rokroskar committed Mar 17, 2023
1 parent ea648a6 commit 6d2d57e
Showing 1 changed file with 57 additions and 1 deletion.
58 changes: 57 additions & 1 deletion .github/workflows/build-and-push-to-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -334,13 +373,22 @@ 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)
export JULIAVERSION="${{ matrix.JULIAVERSIONS }}"
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:
Expand All @@ -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
Expand Down

0 comments on commit 6d2d57e

Please sign in to comment.