Skip to content

Commit

Permalink
Allow use of Kubernetes for Github Actions (#910)
Browse files Browse the repository at this point in the history
* Fix CI for self-hosted runners

* Add quiet flag back into main pipeline

* Fix indentation on master only pipeline
  • Loading branch information
woop authored Jul 31, 2020
1 parent 2c00030 commit 44ac221
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
34 changes: 16 additions & 18 deletions .github/workflows/complete.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: complete workflow
name: complete

on: [push, pull_request]

jobs:
build-push-docker-images:
runs-on: ubuntu-latest
runs-on: [self-hosted]
strategy:
matrix:
component: [core, serving]
Expand All @@ -16,13 +16,11 @@ jobs:
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '290.0.1'
service_account_key: ${{ secrets.GCR_SERVICE_ACCOUNT }}
project_id: kf-feast
export_default_credentials: true
- run: gcloud auth configure-docker --quiet
- name: build image
- name: Build image
run: make build-${{ matrix.component }}-docker REGISTRY=${REGISTRY} VERSION=${GITHUB_SHA}
- name: push image
- name: Push image
run: |
docker push ${REGISTRY}/feast-${{ matrix.component }}:${GITHUB_SHA}
if [ -n "${GITHUB_PR_SHA}" ]; then
Expand All @@ -35,29 +33,29 @@ jobs:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: lint java
- 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
- name: Install dependencies
run: make install-python-ci-dependencies
- name: compile protos
- name: Compile protos
run: make compile-protos-python
- name: lint 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
- name: Install dependencies
run: make install-go-ci-dependencies
- name: lint go
- name: Lint go
run: make lint-go

lint-versions:
Expand All @@ -66,7 +64,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: make lint-versions
run: Make lint-versions

unit-test-java:
runs-on: ubuntu-latest
Expand All @@ -79,7 +77,7 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: test java
- name: Test java
run: make test-java-with-coverage
- uses: actions/upload-artifact@v2
with:
Expand All @@ -91,19 +89,19 @@ jobs:
container: gcr.io/kf-feast/feast-ci:latest
steps:
- uses: actions/checkout@v2
- name: install python
- name: Install python
run: make install-python
- name: test 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
- name: Install dependencies
run: make compile-protos-go
- name: test go
- name: Test go
run: make test-go

integration-test:
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/master_only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,31 @@ on:

jobs:
build-docker-images:
runs-on: [self-hosted, builder]
runs-on: [self-hosted]
strategy:
matrix:
component: [core, serving, jupyter, ci]
steps:
- uses: actions/checkout@v2
- name: build image
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '290.0.1'
export_default_credentials: true
- run: gcloud auth configure-docker --quiet
- name: Build image
run: make build-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA}
- name: push image
- name: Push image
run: make push-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA}
- name: push feast dev
- name: Push image to 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
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${${GITHUB_REF/refs\/tags\//}:1}
- name: push versioned release
- name: Push versioned release
run: |
# Build and push semver tagged commits
Expand All @@ -52,5 +57,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: test docker compose
- name: Test docker compose
run: ./infra/scripts/test-docker-compose.sh

0 comments on commit 44ac221

Please sign in to comment.