Skip to content

Commit

Permalink
Edit old yml & sh files
Browse files Browse the repository at this point in the history
Signed-off-by: Thanawan Atchariyachanvanit <[email protected]>
  • Loading branch information
thanawan-atc committed Jul 7, 2023
1 parent 13149e8 commit 9f9c4c0
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 7 deletions.
23 changes: 19 additions & 4 deletions .ci/run-repository.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set -e
echo -e "\033[34;1mINFO:\033[0m URL ${opensearch_url}\033[0m"
echo -e "\033[34;1mINFO:\033[0m EXTERNAL OS URL ${external_opensearch_url}\033[0m"
echo -e "\033[34;1mINFO:\033[0m VERSION ${OPENSEARCH_VERSION}\033[0m"
echo -e "\033[34;1mINFO:\033[0m IS_DOC: ${IS_DOC}\033[0m"
echo -e "\033[34;1mINFO:\033[0m TYPE: ${TYPE}\033[0m"
echo -e "\033[34;1mINFO:\033[0m TEST_SUITE ${TEST_SUITE}\033[0m"
echo -e "\033[34;1mINFO:\033[0m PYTHON_VERSION ${PYTHON_VERSION}\033[0m"
echo -e "\033[34;1mINFO:\033[0m PYTHON_CONNECTION_CLASS ${PYTHON_CONNECTION_CLASS}\033[0m"
Expand All @@ -33,7 +33,7 @@ docker build \
echo -e "\033[1m>>>>> Run [opensearch-project/opensearch-py-ml container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"


if [[ "$IS_DOC" == "false" ]]; then
if [[ "$TYPE" == "doc" ]]; then
docker run \
--network=${network_name} \
--env "STACK_VERSION=${STACK_VERSION}" \
Expand All @@ -48,7 +48,7 @@ if [[ "$IS_DOC" == "false" ]]; then
docker cp opensearch-py-ml-test-runner:/code/opensearch-py-ml/junit/ ./junit/

docker rm opensearch-py-ml-test-runner
else
elif [[ "$TYPE" == "test" ]]; then
docker run \
--network=${network_name} \
--env "STACK_VERSION=${STACK_VERSION}" \
Expand All @@ -63,4 +63,19 @@ else
docker cp opensearch-py-ml-doc-runner:/code/opensearch-py-ml/docs/build/ ./docs/

docker rm opensearch-py-ml-doc-runner
fi
elif [[ "$TYPE" == "trace" ]]; then
docker run \
--network=${network_name} \
--env "STACK_VERSION=${STACK_VERSION}" \
--env "OPENSEARCH_URL=${opensearch_url}" \
--env "OPENSEARCH_VERSION=${OPENSEARCH_VERSION}" \
--env "TEST_SUITE=${TEST_SUITE}" \
--env "PYTHON_CONNECTION_CLASS=${PYTHON_CONNECTION_CLASS}" \
--env "TEST_TYPE=server" \
--name opensearch-py-ml-trace-runner \
opensearch-project/opensearch-py-ml \
nox -s trace
docker cp opensearch-py-ml-trace-runner:/code/opensearch-py-ml/trace/ ./trace/

docker rm opensearch-py-ml-trace-runner
fi
2 changes: 1 addition & 1 deletion .ci/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export PYTHON_CONNECTION_CLASS="${PYTHON_CONNECTION_CLASS:=Urllib3HttpConnection
export CLUSTER="${1:-opensearch}"
export SECURE_INTEGRATION="${2:-true}"
export OPENSEARCH_VERSION="${3:-latest}"
export IS_DOC="${4:-false}"
export TYPE="${4:-"test"}"
if [[ "$SECURE_INTEGRATION" == "true" ]]; then
export OPENSEARCH_URL_EXTENSION="https"
else
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_deploy_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Integ ${{ matrix.cluster }} secured=${{ matrix.secured }} version=${{matrix.entry.opensearch_version}}
run: "./.ci/run-tests ${{ matrix.cluster }} ${{ matrix.secured }} ${{ matrix.entry.opensearch_version }} true"
run: "./.ci/run-tests ${{ matrix.cluster }} ${{ matrix.secured }} ${{ matrix.entry.opensearch_version }} doc"
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Integ ${{ matrix.cluster }} secured=${{ matrix.secured }} version=${{matrix.entry.opensearch_version}}
run: "./.ci/run-tests ${{ matrix.cluster }} ${{ matrix.secured }} ${{ matrix.entry.opensearch_version }}"
run: "./.ci/run-tests ${{ matrix.cluster }} ${{ matrix.secured }} ${{ matrix.entry.opensearch_version }} test"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/model-uploader.yml
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



0 comments on commit 9f9c4c0

Please sign in to comment.