Skip to content

Commit

Permalink
Add GitHub Action for Testing BLAST DB Updates on EC2
Browse files Browse the repository at this point in the history
Configured workflow to test updating BLAST databases on EC2 instances. This includes setting up Python, mocking BLAST installation, and running the update script in test mode. Secrets are managed through GitHub Actions, and logs are uploaded for review.
  • Loading branch information
nuin committed Aug 27, 2024
1 parent e59d54a commit f43c511
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/test_update_blast_db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test Update BLAST DB on EC2

on:
push:
branches: [ main, automation ]
workflow_dispatch:

jobs:
update-blast-db:
runs-on: ubuntu-latest # This is compatible with act
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Check working directory
run: |
echo "Current working directory: $(pwd)"
ls -la
- name: Set up Python
run: |
python3 -m pip install --upgrade pip
pip3 install poetry
- name: Install Poetry dependencies
run: |
poetry config virtualenvs.create false
poetry install --no-interaction --no-root
- name: Mock BLAST installation
run: |
echo "Mocking BLAST installation for testing"
mkdir -p $HOME/bin
echo -e '#!/bin/bash\necho "Mock blastn $@"' > $HOME/bin/blastn
chmod +x $HOME/bin/blastn
export PATH=$HOME/bin:$PATH
- name: Run BLAST DB update script (Test Mode)
env:
GITHUB_WEBHOOK_SECRET: ${{ secrets.GITHUB_WEBHOOK_SECRET }}
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
echo "Running in test mode - mocking database update"
python3 src/create_blast_db.py \
--config_yaml config/blast_config.yaml \
--environment dev \
--update-slack \
--sync-s3 \
--dry-run
- name: Upload logs
uses: actions/upload-artifact@v3
if: always()
with:
name: blast-db-logs
path: logs/blast_db_creation.log

0 comments on commit f43c511

Please sign in to comment.