[DLS] Models update on self-hosted runners (by @dmichalo via workflow_dispatch) #58
Workflow file for this run
This file contains hidden or 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: "[DLS] Models update on self-hosted runners" | |
| run-name: "[DLS] Models update on self-hosted runners (by @${{ github.actor }} via ${{ github.event_name }})" | |
| on: | |
| schedule: | |
| - cron: '0 4 * * MON' # 4:00 UTC each Monday | |
| workflow_call: | |
| inputs: | |
| test-repo-branch: | |
| description: "Branch in dl-streamer-tests repo (default is main)" | |
| required: false | |
| type: string | |
| default: "main" | |
| workflow_dispatch: | |
| inputs: | |
| test-repo-branch: | |
| description: "Branch in dl-streamer-tests repo (default is main)" | |
| required: false | |
| type: string | |
| default: "main" | |
| permissions: {} | |
| jobs: | |
| update: | |
| name: Update models on self-hosted runner | |
| runs-on: dlstreamer | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out dlstreamer repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 | |
| with: | |
| persist-credentials: false | |
| path: dlstreamer | |
| - name: Check out dlstreamer test repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 | |
| with: | |
| repository: open-edge-platform/dl-streamer-tests | |
| ref: ${{ inputs.test-repo-branch }} | |
| persist-credentials: false | |
| path: dlstreamer-test | |
| sparse-checkout: | | |
| infrastructure/k8s | |
| - name: Set Kubernetes Context | |
| run: | | |
| mkdir -p ~/.kube | |
| echo "${{ secrets.DLS_KUBE_CONFIG }}" > ~/.kube/config | |
| chmod 600 ~/.kube/config | |
| - name: Link dlstreamer repo to home directory for easier access in syncer script | |
| run: | | |
| ln -s $PWD/dlstreamer $HOME/dlstreamer | |
| - name: Deploy and Restart Model Syncer DaemonSet | |
| env: | |
| DLS_MODELS_RSYNC_HOST_IP: ${{ secrets.DLS_MODELS_RSYNC_HOST_IP }} | |
| run: | | |
| cd dlstreamer-test/infrastructure/k8s | |
| envsubst < models-syncer-ds.yaml | kubectl apply -f - | |
| kubectl rollout restart ds model-syncer -n arc-systems | |
| - name: Live Logs | |
| run: | | |
| echo "Monitoring sync process..." | |
| sleep 20 | |
| kubectl logs -l app=model-syncer -n arc-systems -f --max-log-requests=10 | \ | |
| sed 's/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/X.X.X.X/g' |