Skip to content

Commit

Permalink
[SYSTEMDS-3271] Publish docker test image when requested
Browse files Browse the repository at this point in the history
Adds a new docker-testImage.yml to allow manual initialization of building
our test image. This allows us to update the image used in our github
actions if for instance a new R package is added.

This commit also slightly modify the docker action to also build
the python image, when the default night cpu build is made.
Baunsgaard committed Jan 12, 2022

Unverified

This user has not yet uploaded their public signing key.
1 parent d1e1068 commit d64f686
Showing 2 changed files with 90 additions and 20 deletions.
39 changes: 19 additions & 20 deletions .github/workflows/docker-cd.yml
Original file line number Diff line number Diff line change
@@ -24,14 +24,27 @@ name: Docker Image CI and CD

on:
schedule:
- cron: '30 1 * * *' # everyday at 1:30 PM UTC
cron: '30 1 * * *' # everyday at 1:30 PM UTC
paths-ignore:
- 'docs/**'
- '*.md'
- '*.html'
- 'src/test/**'
- 'src/assembly/**'
- 'dev/**'
workflow_dispatch:


jobs:

build:
build-nightly:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image-pattern: nightly
docker-file: sysds.Dockerfile
include:
- image-pattern: python-nightly
docker-file: pythonsysds.Dockerfile

steps:
- name: Checkout
@@ -43,28 +56,14 @@ jobs:
with:
images: apache/systemds
tags: |
type=schedule,pattern=nightly
type=schedule,pattern=${{image-pattern}}
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

## Uncomment the following to inspect buildx build
#
# - name: Inspect builder
# run: |
# echo "Name: ${{ steps.buildx.outputs.name }}"
# echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
# echo "Status: ${{ steps.buildx.outputs.status }}"
# echo "Flags: ${{ steps.buildx.outputs.flags }}"
# echo "Platforms: ${{ steps.buildx.outputs.platforms }}"

# IMPORTANT: The credentials should not be available via the
# Pull request, hence this if condition here.
# github.event_name != 'pull_request'
- name: Login to DockerHub
# if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
@@ -76,7 +75,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/sysds.Dockerfile
file: ./docker/${{docker-file}}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
71 changes: 71 additions & 0 deletions .github/workflows/docker-testImage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#-------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#-------------------------------------------------------------


name: Docker Image CI and CD

# This job only tricker if requested in github.
on:
workflow_dispatch:

jobs:
build-test-image:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image-pattern: testing-latest
docker-file: testsysds.Dockerfile

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Configure Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: apache/systemds
tags: |
type=schedule,pattern=${{image-pattern}}
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# https://github.com/docker/build-push-action
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/${{docker-file}}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit d64f686

Please sign in to comment.