MLFlow: Deploy #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "MLFlow: Deploy" | |
on: | |
workflow_dispatch: | |
inputs: | |
machine: | |
description: 'Which machine to use' | |
required: true | |
default: 'mlflow' | |
type: choice | |
options: | |
- mlflow | |
- local | |
jobs: | |
deploy-mlflow: | |
name: Deploy MLFlow | |
timeout-minutes: 9999999999999999999 # hopefully, never | |
runs-on: ${{ inputs.machine }} | |
container: | |
image: ghcr.io/mlflow/mlflow:v2.11.1 | |
ports: | |
- 8000:8000 | |
env: | |
MLFLOW_AUTH_CONFIG_PATH: "${{ github.workspace }}/auth.ini" | |
MLFLOW_HOST: 0.0.0.0 | |
MLFLOW_PORT: 8000 | |
MLFLOW_WORKERS: 2 | |
MLFLOW_BACKEND_STORE_URI: ${{ secrets.DB_URI }} | |
steps: | |
- run: pip install psycopg2-binary # required for mlflow to talk to postgres | |
# - run: pip install boto3 | |
# - run: pip install mlflow==2.11.1 | |
- uses: "DamianReeves/write-file-action@master" | |
with: | |
path: "${{ github.workspace }}/auth.ini" | |
write-mode: overwrite | |
contents: | | |
[mlflow] | |
admin_username = ${{ secrets.MLFLOW_USERNAME }} | |
admin_password = ${{ secrets.MLFLOW_PASSWORD }} | |
default_permission = READ | |
database_uri = sqlite:///sqlite.db | |
- name: Run MLFlow server | |
run: python -m mlflow server --app-name basic-auth | |