-
Notifications
You must be signed in to change notification settings - Fork 4
106 lines (98 loc) · 3.95 KB
/
reload_demo_data.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Reload data on a demo server
on:
workflow_call:
inputs:
environment:
description: Environment in which to reload data
type: string
required: true
workflow_dispatch:
inputs:
environment:
description: Environment in which to reload data
type: environment
required: true
jobs:
reload:
name: Clean up ${{ inputs.environment }} demo server
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- name: Check out
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Get instance address
id: ec2-describe-instances
run: |
INSTANCE_ADDRESS=$(aws ec2 describe-instances \
--instance-ids ${{ vars.INSTANCE_ID }} \
--query "Reservations[*].Instances[*].[PublicDnsName]" \
--output text)
echo "INSTANCE_ADDRESS=$INSTANCE_ADDRESS" >> "$GITHUB_OUTPUT"
- name: Set up SSH
run: |
mkdir --parents ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/staging
chmod 600 ~/.ssh/staging
cat >>~/.ssh/config <<END
Host staging
HostName ${{ steps.ec2-describe-instances.outputs.INSTANCE_ADDRESS }}
User ec2-user
IdentityFile ~/.ssh/staging
END
ssh-keyscan -H ${{ steps.ec2-describe-instances.outputs.INSTANCE_ADDRESS }} >> ~/.ssh/known_hosts
- name: Create Docker context
run: |
docker context create staging \
--docker host=ssh://staging \
--description "Staging server"
- name: Load data
run: |
docker pull ghcr.io/gmod/apollo-cli:${{ vars.DOCKER_TAG }}
function apollo() {
docker \
--context staging \
run \
--rm \
--interactive \
--add-host host.docker.internal=host-gateway \
--volume /home/ec2-user/.config/apollo-cli:/root/.config/apollo-cli \
--volume /home/ec2-user/data:/data \
--env APOLLO_PROFILE=auto \
ghcr.io/gmod/apollo-cli:${{ vars.DOCKER_TAG }} \
"$@"
}
apollo config address http://host.docker.internal/apollo
apollo config accessType root
apollo config rootCredentials.username ${{ secrets.ROOT_USER_NAME }}
apollo config rootCredentials.password ${{ secrets.ROOT_USER_PASSWORD }}
apollo login --force
apollo assembly get | apollo assembly delete --verbose --assembly -
apollo file get | apollo file delete
apollo assembly \
add-from-fasta \
/data/schistosoma_mansoni.PRJEA36577.WBPS19.genomic.fa.gz \
--fai /data/schistosoma_mansoni.PRJEA36577.WBPS19.genomic.fa.gz.fai \
--gzi /data/schistosoma_mansoni.PRJEA36577.WBPS19.genomic.fa.gz.gzi \
--assembly 'Schistosoma mansoni' \
--not-editable
apollo feature \
import \
--input-file /data/schistosoma_mansoni.PRJEA36577.WBPS19.annotations.genes.gff3 \
--assembly 'Schistosoma mansoni'
apollo assembly \
add-from-fasta \
/data/schistosoma_haematobium.TD2_PRJEB44434.WBPS19.genomic.fa \
--fai /data/schistosoma_haematobium.TD2_PRJEB44434.WBPS19.genomic.fa.gz.fai \
--gzi /data/schistosoma_haematobium.TD2_PRJEB44434.WBPS19.genomic.fa.gz.gzi \
--assembly 'Schistosoma haematobium' \
--not-editable
apollo feature \
import \
--input-file /data/schistosoma_mansoni.PRJEA36577.WBPS19.annotations.genes.gff3 \
--assembly 'Schistosoma haematobium'