Skip to content

Commit

Permalink
[AIFlow] Add github workflow to publish aiflow docker image (#649)
Browse files Browse the repository at this point in the history
* [AIFlow] Add github workflow to publish aiflow docker image (#636)

* [AIFlow] Add github workflow to publish aiflow docker image

* [Airflow] Allow setting image repo and image tag

* [Airflow] Lint ignore frontend node_modules

* [AIFlow] Ignore Lint and license check for ai_flow/frontend/dist

(cherry picked from commit 6150da73c72a2225b0409d48146c48a36a4242dc)

* [AIFlow] Fix AIFlow Image publish ci (#647)

(cherry picked from commit 9b70ebcdad9b1b2d0599bf2d2486f235e00bb6b2)
  • Loading branch information
Sxnan authored Oct 12, 2021
1 parent ac1b208 commit 331c516
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/flink_ai_flow_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ jobs:
- name: Lint with flake8
run: |
# stop the build if there are Python syntax erroservice.pys or undefined names
flake8 flink-ai-flow --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 flink-ai-flow --count --select=E9,F63,F7,F82 --show-source --statistics \
--exclude flink-ai-flow/ai_flow/frontend/node_modules,flink-ai-flow/ai_flow/frontend/dist
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 flink-ai-flow --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 flink-ai-flow --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics \
--exclude flink-ai-flow/ai_flow/frontend/node_modules,flink-ai-flow/ai_flow/frontend/dist
- name: Test with pytest
run: |
/bin/bash flink-ai-flow/run_tests.sh
48 changes: 48 additions & 0 deletions .github/workflows/publish_ai_flow_image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish AIFlow Docker Image

on:
workflow_dispatch:
inputs:
image_repository:
description: 'Image Repository'
required: false
default: 'flinkaiflow/flink-ai-flow-dev'
image_tag:
description: 'Image Tag'
required: false
default: ''
schedule:
- cron: '0 16 * * *'

jobs:
push_to_registry:
name: Push Docker image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Set variables
env:
DEFAULT_IMAGE_REPO: 'flinkaiflow/flink-ai-flow-dev'
run: |
IMAGE_REPO=${{ github.event.inputs.image_repository || env.DEFAULT_IMAGE_REPO }}
IMAGE_TAG=${{ github.event.inputs.image_tag }}
[ -z ${IMAGE_TAG} ] && IMAGE_TAG=${GITHUB_REF##*/}-`echo ${GITHUB_SHA} | cut -c1-8`
echo "IMAGE_REPO=${IMAGE_REPO}" >> $GITHUB_ENV
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
- name: Log in to to docker registry
run: |
docker login --username=${{ secrets.IMAGE_REGISTRY_USERNAME }} --password=${{ secrets.IMAGE_REGISTRY_PASSWORD }} ${{ secrets.LOGIN_REGISTRY }}
- name: Build Image
run: |
cd ./flink-ai-flow
echo building image with repo: ${{ env.IMAGE_REPO }} tag: ${{ env.IMAGE_TAG }}
bash build_docker_image.sh ${{ env.IMAGE_REPO }}:${{ env.IMAGE_TAG }}
- name: Push Image
run: |
echo pushing ${{ env.IMAGE_REPO }}:${{ env.IMAGE_TAG }}
docker push ${{ env.IMAGE_REPO }}:${{ env.IMAGE_TAG }}
1 change: 1 addition & 0 deletions flink-ai-flow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
<exclude>ai_flow/java/client/target/**/*</exclude>
<exclude>ai_flow/java/.idea/**/*</exclude>
<exclude>ai_flow/frontend/node_modules/**/*</exclude>
<exclude>ai_flow/frontend/dist/**/*</exclude>
</excludes>
</configuration>
</plugin>
Expand Down

0 comments on commit 331c516

Please sign in to comment.