Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dummy dataset #156

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 64 additions & 18 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,54 @@ jobs:
env:
VERBOSE: 0
PYTHONUNBUFFERED: 1
DATA_AWS_S3_BUCKET: ${{ secrets.DATA_AWS_S3_BUCKET }}
DATA_AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.DATA_AWS_CLOUDFRONT_DISTRIBUTION_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2
GH_TOKEN: ${{ github.token }}

steps:
- name: config
id: config
run: |
echo 'is_fork=${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.fork || ((github.event.pull_request.head.repo.full_name || github.event.pull_request.base.repo.full_name) == github.repository)) }}' >> $GITHUB_OUTPUT

echo 'should_deploy=${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/release' }}' >> $GITHUB_OUTPUT

echo 'is_release=${{ github.ref == 'refs/heads/release' }}' >> $GITHUB_OUTPUT

- name: "DEBUG"
run: |
set +x

echo is_fork=${{ steps.config.outputs.is_fork }}
echo should_deploy=${{ steps.config.outputs.should_deploy }}
echo is_release=${{ steps.config.outputs.is_release }}

echo '\n'

echo 'github.ref =' ${{ github.ref }}
echo 'github.event_name =' ${{ github.event_name }}
echo 'github.repository =' ${{ github.repository }}

echo '\n'

echo 'github.event.pull_request.head.repo.fork =' ${{ github.event.pull_request.head.repo.fork }}
echo 'github.event.pull_request.head.repo.full_name =' ${{ github.event.pull_request.head.repo.full_name }}

echo '\n'

echo 'github.event.pull_request.base.repo.fork =' ${{ github.event.pull_request.base.repo.fork }}
echo 'github.event.pull_request.base.repo.full_name =' ${{ github.event.pull_request.base.repo.full_name }}

echo '\n'

echo 'github.event.pull_request.head.repo.full_name || github.event.pull_request.base.repo.full_name =' ${{ github.event.pull_request.head.repo.full_name || github.event.pull_request.base.repo.full_name }}
echo '(github.event.pull_request.head.repo.full_name || github.event.pull_request.base.repo.full_name) == github.repository =' ${{ (github.event.pull_request.head.repo.full_name || github.event.pull_request.base.repo.full_name) == github.repository }}
echo 'github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork || ((github.event.pull_request.head.repo.full_name || github.event.pull_request.base.repo.full_name) == github.repository)) =' ${{ github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork || ((github.event.pull_request.head.repo.full_name || github.event.pull_request.base.repo.full_name) == github.repository)) }}

- name: "Checkout code"
uses: actions/checkout@v4
with:
fetch-depth: 0 # Number of commits to fetch. 0 indicates all history for all branches and tags.
fetch-tags: true # Whether to fetch tags, even if fetch-depth > 0.
ref: ${{ github.event.pull_request.head.ref || github.ref_name }}
ref: ${{ github.event.pull_request.head.ref || github.ref }}

- name: "Install system dependencies"
run: |
Expand All @@ -54,33 +88,45 @@ jobs:
run: |
pip3 install -r requirements.txt

- name: "Install awscli"
- name: "Rebuild datasets (fork)"
if: ${{ steps.config.outputs.is_fork == 'true' }}
run: |
pushd /tmp >/dev/null
curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip -oqq awscliv2.zip
sudo ./aws/install --update
popd >/dev/null
aws --version
./scripts/rebuild --input-dir 'data/' --output-dir 'data_output/' --no-pull

- name: "Rebuild, commit and push datasets"
if: github.ref != 'refs/heads/release'
- name: "Rebuild, commit and push datasets (non-release branch)"
if: ${{ steps.config.outputs.is_fork != 'true' && steps.config.outputs.is_release != 'true' }}
run: |
git config --global user.email "${{ secrets.BOT_GIT_USER_EMAIL }}"
git config --global user.name "${{ secrets.BOT_GIT_USER_NAME }}"

./scripts/rebuild --input-dir 'data/' --output-dir 'data_output/' --push --repo="${GITHUB_REPOSITORY}"

- name: "Rebuild, commit, push and make a release"
if: github.ref == 'refs/heads/release'
- name: "Rebuild, commit, push and make a release (release branch)"
if: ${{ steps.config.outputs.is_fork != 'true' && steps.config.outputs.is_release == 'true' }}
run: |
git config --global user.email "${{ secrets.BOT_GIT_USER_EMAIL }}"
git config --global user.name "${{ secrets.BOT_GIT_USER_NAME }}"

./scripts/rebuild --input-dir 'data/' --output-dir 'data_output/' --release --repo="${GITHUB_REPOSITORY}"

- name: "Install awscli"
if: ${{ steps.config.outputs.is_fork != 'true' && steps.config.outputs.should_deploy == 'true' }}
run: |
pushd /tmp >/dev/null
curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip -oqq awscliv2.zip
sudo ./aws/install --update
popd >/dev/null
aws --version

- name: "Deploy dataset server"
if: ${{ endsWith(github.ref, '/master') || endsWith(github.ref, '/staging') || endsWith(github.ref, '/release') }}
if: ${{ steps.config.outputs.is_fork != 'true' && steps.config.outputs.should_deploy == 'true' }}
env:
DATA_AWS_S3_BUCKET: ${{ secrets.DATA_AWS_S3_BUCKET }}
DATA_AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.DATA_AWS_CLOUDFRONT_DISTRIBUTION_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2
run: |
./scripts/upload 'data_output/'

Expand Down
3 changes: 3 additions & 0 deletions data/community/dummy1/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Unreleased

First release
1 change: 1 addition & 0 deletions data/community/dummy1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# DUMMY
3 changes: 3 additions & 0 deletions data/community/dummy1/genome_annotation.gff3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#DUMMY
ref dummy region 1 120 . + . ID=ref
ref dummy CDS 1 15 . + 0 Name=HA1;gene=HA1
24 changes: 24 additions & 0 deletions data/community/dummy1/pathogen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"attributes": {
"name": "DUMMY",
"reference accession": "D1",
"reference name": "DUMMY/1"
},
"defaultGene": "D",
"deprecated": false,
"enabled": true,
"experimental": true,
"geneOrderPreference": [
"D", "U", "M"
],
"files": {
"changelog": "CHANGELOG.md",
"examples": "sequences.fasta",
"genomeAnnotation": "genome_annotation.gff3",
"pathogenJson": "pathogen.json",
"readme": "README.md",
"reference": "reference.fasta",
"treeJson": "tree.json"
},
"schemaVersion": "3.0.0"
}
2 changes: 2 additions & 0 deletions data/community/dummy1/reference.fasta
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>Dummy1/Ref
AAAAAAAAAAAAAAAGTCGCTGATCGATCGGCTAGCTGCTCGATCGATCGGCTAGCTATTCATTTTCGATCTCCTCTCGCGATCGTATAGCTACGCATCGACTACTGCATCACTGACTTG
18 changes: 18 additions & 0 deletions data/community/dummy1/sequences.fasta
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
>ref
AAAAAAAAAAAAAAAGTCGCTGATCGATCGGCTAGCTGCTCGATCGATCGGCTAGCTATTCATTTTCGATCTCCTCTCGCGATCGTATAGCTACGCATCGACTACTGCATCACTGACTTG
>A
GGAAAAAAAAAAAAAGTCGCTGATCGATCGGCTAGCTGCTCGATCGATCGGCTAGCTATTCATTTTCGATCTCCTCTCGCGATCGTATAGCTACGCATCGACTACTGCATCACTGACTTG
>A1
GAAAAAAGAAAAAAAGTCGCTGATCGATCGGCTAGCTGCTCGATCGATCGGCTAGCTATTCATTTTCGATCTCCTCTCGCGATCGTATAGCTACGCATCGACTACTGCATCACTGACTTG
>B1
AACCAACCAAAAAAAGTCGCTGATCGATCGGCTAGCTGCTCGATCGATCGGCTAGCTATTCATTTTCGATCTCCTCTCGCGATCGTATAGCTACGCATCGACTACTGCATCACTGACTTG
>B2
AACCAACCAAAAAAAGTCGCTGATCGATCGGCTAGCTGCTCGATCGATCGGCTAGCTATTCATTTTCGATCTCCTCTCGCGATCGTATAGCTACGCATCGACTACTGCATCACTGACTTG
>C
AACAGAAAAAAAAAAGTCGCTGATCGATCGGCTAGCTGCTCGATCGATCGGCTAGCTATTCATTTTCGATCTCCTCTCGCGATCGTATAGCTACGCATCGACTACTGCATCACTGACTTG
>BC1
AACAAAAAAAGAAAAGTCGCTGATCGATCGGCTAGCTGCTCGATCGATCGGCTAGCTATTCATTTTCGATCTCCTCTCGCGATCGTATAGCTACGCATCGACTACTGCATCACTGACTTG
>BC2
AACAAAAAAAGATAAGTCGCTGATCGATCGGCTAGCTGCTCGATCGATCGGCTAGCTATTCATTTTCGATCTCCTCTCGCGATCGTATAGCTACGCATCGACTACTGCATCACTGACTTG
>BC3
AACAAAAAAAGATCAGTCGCTGATCGATCGGCTAGCTGCTCGATCGATCGGCTAGCTATTCATTTTCGATCTCCTCTCGCGATCGTATAGCTACGCATCGACTACTGCATCACTGACTTG
109 changes: 109 additions & 0 deletions data/community/dummy1/tree.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"meta": {
"data_provenance": [
{
"name": "fictional data"
}
],
"display_defaults": {},
"title": "Dummy nextclade reference tree"
},
"tree": {
"branch_attrs": {
"mutations": {
"nuc": []
}
},
"children": [
{
"branch_attrs": {
"mutations": {
"HA1": [
"K1G"
],
"nuc": [
"A1G",
"A2G"
]
}
},
"children": [],
"name": "A",
"node_attrs": {
"clade_membership": {
"value": "unassigned"
},
"div": 0.016666666666666666
}
},
{
"branch_attrs": {
"mutations": {
"HA1": [
"K1N"
],
"nuc": [
"A3C"
]
}
},
"children": [
{
"branch_attrs": {
"mutations": {
"HA1": [
"K2Q"
],
"nuc": [
"A4C"
]
}
},
"children": [],
"name": "B",
"node_attrs": {
"clade_membership": {
"value": "unassigned"
},
"div": 0.016666666666666666
}
},
{
"branch_attrs": {
"mutations": {
"HA1": [
"K2R"
],
"nuc": [
"A5G"
]
}
},
"children": [],
"name": "C",
"node_attrs": {
"clade_membership": {
"value": "unassigned"
},
"div": 0.016666666666666666
}
}
],
"name": "NODE_0000001",
"node_attrs": {
"clade_membership": {
"value": "unassigned"
},
"div": 0.008333333333333333
}
}
],
"name": "NODE_0000000",
"node_attrs": {
"clade_membership": {
"value": "unassigned"
},
"div": 0
}
}
}