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

Add docker image building to GitHub Actions and consolidate workflows #898

Merged
merged 6 commits into from
Jul 27, 2020
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
42 changes: 0 additions & 42 deletions .github/workflows/code_standards.yaml

This file was deleted.

117 changes: 117 additions & 0 deletions .github/workflows/complete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: complete workflow

on: [push, pull_request]

jobs:
build-push-docker-images:
runs-on: [self-hosted, builder]
strategy:
matrix:
component: [core, serving]
steps:
- uses: actions/checkout@v2
- name: build image
run: make build-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA}
- name: push image
run: make push-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA}

lint-java:
container: gcr.io/kf-feast/feast-ci:latest
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: lint java
run: make lint-java

lint-python:
container: gcr.io/kf-feast/feast-ci:latest
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: make install-python-ci-dependencies
- name: compile protos
run: make compile-protos-python
- name: lint python
run: make lint-python

lint-go:
container: gcr.io/kf-feast/feast-ci:latest
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: make install-go-ci-dependencies
- name: lint go
run: make lint-go

lint-versions:
container: gcr.io/kf-feast/feast-ci:latest
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: make lint-versions

unit-test-java:
runs-on: ubuntu-latest
container: gcr.io/kf-feast/feast-ci:latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: test java
run: make test-java-with-coverage
- uses: actions/upload-artifact@v2
with:
name: java-coverage-report
path: ${{ github.workspace }}/docs/coverage/java/target/site/jacoco-aggregate/

unit-test-python:
runs-on: ubuntu-latest
container: gcr.io/kf-feast/feast-ci:latest
steps:
- uses: actions/checkout@v2
- name: install python
run: make install-python
- name: test python
run: make test-python

unit-test-go:
runs-on: ubuntu-latest
container: gcr.io/kf-feast/feast-ci:latest
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: make compile-protos-go
- name: test go
run: make test-go

integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: '11'
java-package: jdk
architecture: x64
- name: Run integration tests
run: make test-java-integration

load-test:
runs-on: [self-hosted, load]
needs: build-push-docker-images
steps:
- uses: actions/checkout@v2
- name: Run load test
run: make test-load GIT_SHA=${GITHUB_SHA}
- uses: actions/upload-artifact@v2
with:
name: load-test-results
path: load-test-output/
15 changes: 0 additions & 15 deletions .github/workflows/docker_compose_tests.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/integration_tests.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/load_test.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/master_only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: master only

on:
push:
branches: master
tags:
- 'v*.*.*'

jobs:
build-docker-images:
runs-on: [self-hosted, builder]
strategy:
matrix:
component: [core, serving, jupyter, ci]
steps:
- uses: actions/checkout@v2
- name: build image
run: make build-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA}
- name: push image
run: make push-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA}
- name: push feast dev
run: |
if [ ${GITHUB_REF#refs/*/} == "master" ]; then
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:dev
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:dev
fi
- name: get version
id: get_version
run: echo ::set-output name=VERSION::${${GITHUB_REF/refs\/tags\//}:1}
- name: push versioned release
run: |

# Build and push semver tagged commits
rx='^([0-9]+\.){0,2}(\*|[0-9]+)$'
if [[ ${{ steps.get_version.outputs.VERSION }} =~ $rx ]]; then

docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }}
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }}

# Also update "latest" image if tagged commit is pushed to stable branch
HIGHEST_SEMVER_TAG=$(git tag -l --sort -version:refname | head -n 1)
echo "Only push to latest tag if tag is the highest semver version $HIGHEST_SEMVER_TAG"

if [ ${{ steps.get_version.outputs.VERSION }} == "${HIGHEST_SEMVER_TAG:1}" ]
then
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }}
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }}
fi
fi

tests-docker-compose:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: test docker compose
run: ./infra/scripts/test-docker-compose.sh
45 changes: 0 additions & 45 deletions .github/workflows/unit_tests.yml

This file was deleted.

Loading