forked from opensearch-project/opensearch-py-ml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Thanawan Atchariyachanvanit <[email protected]>
- Loading branch information
1 parent
13149e8
commit 9f9c4c0
Showing
5 changed files
with
120 additions
and
7 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: Model Auto-tracing & Uploading | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
model_id: | ||
description: "Model ID for auto-tracing and uploading (e.g. sentence-transformers/msmarco-distilbert-base-tas-b)" | ||
required: true | ||
type: string | ||
model_version: | ||
description: "Model version number (e.g. 1.0.1)" | ||
required: true | ||
type: string | ||
tracing_format: | ||
description: "Model format for auto-tracing" | ||
required: true | ||
type: choice | ||
options: | ||
- "TORCH_SCRIPT" | ||
- "ONNX" | ||
- "Both" | ||
embedding_dimension: | ||
description: "(Optional) You can add the embedding dimension of the model here if it does not exist in original config.json file. Else, it will use 768." | ||
required: false | ||
type: int | ||
pooling_mode: | ||
description: "(Optional) You can specify the pooling mode of the model here if it does not exist in original config.json file." | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
model-tracing: | ||
name: model-tracing | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
cluster: ["opensearch"] | ||
secured: ["true"] | ||
entry: | ||
- { opensearch_version: 2.7.0 } | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python 3 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Autotracing ${{ matrix.cluster }} secured=${{ matrix.secured }} version=${{matrix.entry.opensearch_version}} | ||
run: "./.ci/run-tests ${{ matrix.cluster }} ${{ matrix.secured }} ${{ matrix.entry.opensearch_version }} trace" | ||
|
||
|
||
# - name: Install dependencies | ||
# run: python3 -m pip install opensearch-py-ml | ||
# - name: Autotrace and Upload | ||
# run: | | ||
# echo "Model Name: ${{ github.event.inputs.model_name }}" | ||
# echo "Model Version Number: ${{ github.event.inputs.model_version }}" | ||
# python3 automated_actions/auto_script.py ${{ github.event.inputs.model_id }} ${{ github.event.inputs.model_version }} ${{ github.event.inputs.tracing_format }} -ed ${{ github.event.inputs.embedding_dimensions }} -pm ${{ github.event.inputs.pooling_mode }} | ||
- name: Publish artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: published-app | ||
path: 'TODO' | ||
|
||
# model-uploading: | ||
# runs-on: 'ubuntu-latest' | ||
# | ||
# steps: | ||
# - name: Checkout Repository | ||
# uses: actions/checkout@v3 | ||
# - id: get_approvers | ||
# run: | | ||
# echo "approvers=$(cat .github/CODEOWNERS | grep @ | tr -d '* ' | sed 's/@/,/g' | sed 's/,//1')" >> $GITHUB_OUTPUT | ||
# - uses: trstringer/manual-approval@v1 | ||
# with: | ||
# secret: ${{ github.TOKEN }} | ||
# approvers: ${{ steps.get_approvers.outputs.approvers }} | ||
# minimum-approvals: 2 | ||
# issue-title: 'Upload opensearch-py-ml model to Amazon S3 Bucket' | ||
# issue-body: "Please approve or deny opensearch-py-ml model uploading. **Tag**: ${{ github.ref_name }} **Commit**: ${{ github.sha }}" | ||
# exclude-workflow-initiator-as-approver: true | ||
# - name: Download artifact | ||
# uses: actions/download-artifact@v2 | ||
# with: | ||
# name: published-app | ||
# path: 'TODO' | ||
# - name: Configure AWS credentials | ||
# uses: aws-actions/configure-aws-credentials@v2 | ||
# with: | ||
# role-to-assume: ${{ secrets.MODEL_UPLOADER_ROLE }} | ||
# aws-region: ${{ secrets.MODEL_UPLOADER_AWS_REGION }} | ||
# - name: Copy files to the bucket | ||
# run: | | ||
# aws s3 sync . s3://to-do-bucket | ||
|
||
|
||
|