Skip to content

Commit

Permalink
Refactor pyfunc server base github action jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Arief Rahmansyah committed Nov 30, 2023
1 parent 5b95a60 commit 5510420
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 32 deletions.
38 changes: 15 additions & 23 deletions .github/workflows/merlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,23 @@ jobs:

test-pyfunc-server:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }}
PIPENV_DEFAULT_PYTHON_VERSION: 3.10
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: 3.10
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
key: ${{ runner.os }}-pip-3.10-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-3.10-
- uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-python-${{ matrix.python-version }}-pipenv-pyfunc-server
key: ${{ runner.os }}-python-3.10-pipenv-pyfunc-server
- name: Install dependencies
working-directory: ./python/pyfunc-server
run: |
Expand Down Expand Up @@ -279,25 +275,21 @@ jobs:
path: merlin-pyspark-base-py${{ matrix.python-version }}.${{ needs.create-version.outputs.version }}.tar
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}

build-pyfunc-server:
build-pyfunc-server-base:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["38", "39", "310"]
needs:
- create-version
steps:
- uses: actions/checkout@v2
- name: Build Pyfunc Server Docker py${{ matrix.python-version }}
run: docker build -t merlin-pyfunc-base-py${{ matrix.python-version }}:${{ needs.create-version.outputs.version }} --build-arg PYTHON_VERSION=${{ matrix.python-version }} -f python/pyfunc-server/docker/base.Dockerfile python
- name: Save Pyfunc Server Docker py${{ matrix.python-version }}
run: docker image save --output merlin-pyfunc-base-py${{ matrix.python-version }}.${{ needs.create-version.outputs.version }}.tar merlin-pyfunc-base-py${{ matrix.python-version }}:${{ needs.create-version.outputs.version }}
- name: Publish Pyfunc Server Docker Artifact py${{ matrix.python-version }}
- name: Build Pyfunc Server Base Docker
run: docker build -t merlin-pyfunc-base:${{ needs.create-version.outputs.version }} -f python/pyfunc-server/docker/base.Dockerfile python
- name: Save Pyfunc Server Base Docker
run: docker image save --output merlin-pyfunc-base.${{ needs.create-version.outputs.version }}.tar merlin-pyfunc-base:${{ needs.create-version.outputs.version }}
- name: Publish Pyfunc Server Base Docker Artifact
uses: actions/upload-artifact@v2
with:
name: merlin-pyfunc-base-py${{ matrix.python-version }}.${{ needs.create-version.outputs.version }}.tar
path: merlin-pyfunc-base-py${{ matrix.python-version }}.${{ needs.create-version.outputs.version }}.tar
name: merlin-pyfunc-base.${{ needs.create-version.outputs.version }}.tar
path: merlin-pyfunc-base.${{ needs.create-version.outputs.version }}.tar
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}

build-transformer:
Expand Down Expand Up @@ -439,10 +431,10 @@ jobs:
uses: ./.github/workflows/release.yml
needs:
- create-version
- e2e-test
# - e2e-test
- test-api
- test-python-sdk
- test-pyfunc-server
- build-pyfunc-server-base
- test-batch-predictor
with:
version: ${{ needs.create-version.outputs.version }}
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,8 @@ jobs:
docker tag merlin-pyspark-base-py${{ matrix.python-version }}:${{ inputs.version }} ${IMAGE_TAG}
docker push ${IMAGE_TAG}
publish-pyfunc:
publish-pyfunc-base:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["38", "39", "310"]
steps:
- name: Log in to the Container registry
uses: docker/login-action@v1
Expand All @@ -142,14 +138,14 @@ jobs:
- name: Download API Docker Artifact
uses: actions/download-artifact@v2
with:
name: merlin-pyfunc-base-py${{ matrix.python-version }}.${{ inputs.version }}.tar
name: merlin-pyfunc-base.${{ inputs.version }}.tar
- name: Retag and Push Docker Image
env:
CONTAINER_REGISTRY: ${{ env.DOCKER_REGISTRY }}/${{ github.repository }}
run: |
IMAGE_TAG="${{ env.CONTAINER_REGISTRY }}/merlin-pyfunc-base-py${{ matrix.python-version }}:${{ inputs.version }}"
docker image load --input merlin-pyfunc-base-py${{ matrix.python-version }}.${{ inputs.version }}.tar
docker tag merlin-pyfunc-base-py${{ matrix.python-version }}:${{ inputs.version }} ${IMAGE_TAG}
IMAGE_TAG="${{ env.CONTAINER_REGISTRY }}/merlin-pyfunc-base:${{ inputs.version }}"
docker image load --input merlin-pyfunc-base.${{ inputs.version }}.tar
docker tag merlin-pyfunc-base:${{ inputs.version }} ${IMAGE_TAG}
docker push ${IMAGE_TAG}
publish-inference-logger:
Expand Down

0 comments on commit 5510420

Please sign in to comment.