Skip to content

Commit

Permalink
Merge branch 'main' into feature-update
Browse files Browse the repository at this point in the history
  • Loading branch information
DhanshreeA authored Dec 27, 2024
2 parents 5d58cc9 + 734b33d commit cca5251
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 40 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/post-model-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,35 @@ jobs:
REPO_NAME: ${{ github.event.repository.name }}
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }}
run: |
source activate
pip install requests pyairtable
echo "Updating metadata to AirTable looking at owner: $USER_NAME"
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/update_metadata_to_airtable.py
python3 update_metadata_to_airtable.py $USER_NAME $REPO_NAME $BRANCH $AIRTABLE_API_KEY
rm update_metadata_to_airtable.py
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/airtableops.py
python3 airtableops.py airtable-update --user $USER_NAME --repo $REPO_NAME --branch $BRANCH --api-key $AIRTABLE_API_KEY
rm airtableops.py
- name: sync metadata to S3 JSON
id: sync-metadata-to-s3
env:
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
source activate
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/convert_airtable_to_json.py
pip install boto3 requests pyairtable
python convert_airtable_to_json.py $AIRTABLE_API_KEY $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY
rm convert_airtable_to_json.py
- name: Update README file
id: update-readme-file
env:
MODEL_ID: ${{ github.event.repository.name }}
run: |
echo "Updating README file with AirTable metadata for model: $MODEL_ID"
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/update_readme_from_airtable.py
python3 update_readme_from_airtable.py $MODEL_ID .
rm update_readme_from_airtable.py
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/airtableops.py
python3 airtableops.py readme-update --repo $MODEL_ID --path .
rm airtableops.py
less README.md
- name: Commit and push changes done to the README file
Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/test-model-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,6 @@ jobs:
conda init
python -m pip install git+https://github.com/ersilia-os/ersilia.git
- name: Check metadata before updating to AirTable
id: check-metadata
env:
USER_NAME: ${{ github.event.pull_request.head.repo.owner.login }}
BRANCH: "main"
REPO_NAME: ${{ github.event.repository.name }}
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: |
source activate
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/update_metadata_to_airtable.py
python3 update_metadata_to_airtable.py $USER_NAME $REPO_NAME $BRANCH
- name: Predict output
env:
MODEL_ID: ${{ github.event.repository.name }}
Expand All @@ -81,10 +66,9 @@ jobs:
ersilia -v fetch $MODEL_ID --from_dir .
ersilia -v serve $MODEL_ID
ersilia example -n 5 -f input.csv --predefined
ersilia -v api -i input.csv
ersilia -v run -i input.csv
ersilia close
echo "Perform detail check on model: $MODEL_ID"
ersilia delete $MODEL_ID
ersilia -v test $MODEL_ID -d . --inspect -l deep
- name: Upload log output
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/test-model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,24 @@ jobs:
max_attempts: 3
command: |
source activate
pip install requests pyairtable
echo "Updating metadata to AirTable looking at owner: $USER_NAME"
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/update_metadata_to_airtable.py
python3 update_metadata_to_airtable.py $USER_NAME $REPO_NAME $BRANCH $AIRTABLE_API_KEY
rm update_metadata_to_airtable.py
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/airtableops.py
python3 airtableops.py airtable-update --user $USER_NAME --repo $REPO_NAME --branch $BRANCH --api-key $AIRTABLE_API_KEY
rm airtableops.py
- name: sync metadata to S3 JSON
id: sync-metadata-to-s3
env:
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
source activate
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/convert_airtable_to_json.py
pip install boto3 requests pyairtable
python convert_airtable_to_json.py $AIRTABLE_API_KEY $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY
rm convert_airtable_to_json.py
- name: Update README file
id: update-readme-file
Expand All @@ -83,9 +97,9 @@ jobs:
run: |
source activate
echo "Updating README file with AirTable metadata for model: $MODEL_ID"
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/update_readme_from_airtable.py
python3 update_readme_from_airtable.py $MODEL_ID .
rm update_readme_from_airtable.py
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/airtableops.py
python3 airtableops.py readme-update --repo $MODEL_ID --path .
rm airtableops.py
less README.md
- name: Commit and push changes done to the README file
Expand Down
38 changes: 36 additions & 2 deletions .github/workflows/upload-bentoml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
# We cannot tag it as anything other than latest because
# ersilia cli only looks for the 'latest' tag
- name: Build only AMD64 Image for Testing
- name: Build only AMD64 Image for Testing
id: buildForTest
uses: docker/build-push-action@v5
with:
Expand Down Expand Up @@ -113,16 +113,50 @@ jobs:
fi
rm output.csv
# If test failed, we tag the image as dev
- name: Tag Dev image
id: tagDevImage
if: steps.testBuiltImage.outcome == 'failure'
run: |
docker tag ersiliaos/${{ github.event.repository.name }}:latest ersiliaos/${{ github.event.repository.name }}:dev
docker push ersiliaos/${{ github.event.repository.name }}:dev
- name: Create a Test issue
if: steps.testBuiltImage.outcome == 'failure'
uses: actions-ecosystem/action-create-issue@b63bc2bbacb6a838dfe4a9f70da6665ae0962a49
id: createFailureIssue
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
title: Failed model build
body: |
The model build failed. Please check the logs and fix the issue.
A dev image has been pushed to DockerHub for reference.
labels: |
bug
# If test succeeds we tag the image with timestamp and latest
- name: Get date
id: get-date
env:
DATE: ${{ github.run_started_at }}
run: |
# Keep only the date part
DATE=$(echo $DATE | cut -d 'T' -f 1)
echo "date=$DATE" >> $GITHUB_OUTPUT
- name: Build and push
id: buildMultiple
if: steps.testBuiltImage.outcome == 'success'
continue-on-error: true
uses: docker/[email protected]
timeout-minutes: 45
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ersiliaos/${{ github.event.repository.name }}:latest
tags: |
ersiliaos/${{ github.event.repository.name }}:latest
ersiliaos/${{ github.event.repository.name }}:${{ steps.get-date.outputs.date }}
- name: Set build failure output
id: buildCheck
Expand Down
38 changes: 36 additions & 2 deletions .github/workflows/upload-ersilia-pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,50 @@ jobs:
fi
rm output.csv
# If test failed, we tag the image as dev
- name: Tag Dev image
id: tagDevImage
if: steps.testBuiltImageErsiliaPack.outcome == 'failure'
run: |
docker tag ersiliaos/${{ github.event.repository.name }}:latest ersiliaos/${{ github.event.repository.name }}:dev
docker push ersiliaos/${{ github.event.repository.name }}:dev
- name: Create a Test issue
if: steps.testBuiltImageErsiliaPack.outcome == 'failure'
uses: actions-ecosystem/action-create-issue@b63bc2bbacb6a838dfe4a9f70da6665ae0962a49
id: createFailureIssue
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
title: Failed model build
body: |
The model build failed. Please check the logs and fix the issue.
A dev image has been pushed to DockerHub for reference.
labels: |
bug
# If test succeeds we tag the image with timestamp and latest
- name: Get date
id: get-date
env:
DATE: ${{ github.run_started_at }}
run: |
# Keep only the date part
DATE=$(echo $DATE | cut -d 'T' -f 1)
echo "date=$DATE" >> $GITHUB_OUTPUT
- name: Build and push
id: buildMultiple
if: steps.testBuiltImageErsiliaPack.outcome == 'success'
continue-on-error: true
uses: docker/[email protected]
timeout-minutes: 45
with:
context: ../
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ersiliaos/${{ github.event.repository.name }}:latest
tags: |
ersiliaos/${{ github.event.repository.name }}:latest
ersiliaos/${{ github.event.repository.name }}:${{ steps.get-date.outputs.date }}
- name: Set build failure output
id: buildCheck
Expand Down
28 changes: 21 additions & 7 deletions .github/workflows/upload-model-to-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,35 @@ jobs:
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }}
run: |
source activate
pip install requests pyairtable
echo "Updating metadata to AirTable looking at owner: $USER_NAME"
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/update_metadata_to_airtable.py
python3 update_metadata_to_airtable.py $USER_NAME $REPO_NAME $BRANCH $AIRTABLE_API_KEY
rm update_metadata_to_airtable.py
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/airtableops.py
python3 airtableops.py airtable-update --user $USER_NAME --repo $REPO_NAME --branch $BRANCH --api-key $AIRTABLE_API_KEY
rm airtableops.py
- name: sync metadata to S3 JSON
id: sync-metadata-to-s3
env:
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
source activate
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/convert_airtable_to_json.py
pip install boto3 requests pyairtable
python convert_airtable_to_json.py $AIRTABLE_API_KEY $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY
rm convert_airtable_to_json.py
- name: Update README file
id: update-readme-file
env:
MODEL_ID: ${{ github.event.repository.name }}
run: |
source activate
echo "Updating README file with AirTable metadata for model: $MODEL_ID"
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/update_readme_from_airtable.py
python3 update_readme_from_airtable.py $MODEL_ID .
rm update_readme_from_airtable.py
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/airtableops.py
python3 airtableops.py readme-update --repo $MODEL_ID --path .
rm airtableops.py
less README.md
- name: Commit and push changes done to the README file
Expand Down

0 comments on commit cca5251

Please sign in to comment.