Skip to content

Commit

Permalink
make ena-submission github repo public, remove need for PAT and USERN…
Browse files Browse the repository at this point in the history
…AME.
  • Loading branch information
anna-parker committed Sep 18, 2024
1 parent af9849c commit 59aad25
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 44 deletions.
4 changes: 1 addition & 3 deletions ena-submission/config/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ unique_project_suffix: Loculus
ena_submission_username: fake-user
ena_submission_password: fake-password
ena_submission_url: https://wwwdev.ebi.ac.uk/ena/submit/drop-box/submit # TODO(https://github.com/loculus-project/loculus/issues/2425): update in production
github_username: fake_username
github_pat: fake_pat
github_url: https://api.github.com/repos/pathoplexus/ena-submission/contents/test/approved_ena_submission_list.json?ref=main # TODO(https://github.com/loculus-project/loculus/issues/2425): update in production
github_url: https://raw.githubusercontent.com/pathoplexus/ena-submission/main/test/approved_ena_submission_list.json # TODO(https://github.com/loculus-project/loculus/issues/2425): update in production
ena_reports_service_url: https://wwwdev.ebi.ac.uk/ena/submit/report # TODO(https://github.com/loculus-project/loculus/issues/2425): update in production
#ena_checklist: ERC000033 - do not use until all fields are mapped to ENA accepted options
metadata_mapping:
Expand Down
15 changes: 1 addition & 14 deletions ena-submission/scripts/trigger_submission_to_ena.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import base64
import json
import logging
import os
import time
from dataclasses import dataclass
from typing import Any
Expand All @@ -13,7 +12,6 @@
import requests
import yaml
from psycopg2.pool import SimpleConnectionPool
from requests.auth import HTTPBasicAuth
from submission_db_helper import (
SubmissionTableEntry,
add_to_submission_table,
Expand All @@ -37,8 +35,6 @@ class Config:
db_username: str
db_password: str
db_host: str
github_username: str
github_pat: str
github_url: str


Expand Down Expand Up @@ -102,17 +98,8 @@ def trigger_submission_to_ena(log_level, config_file, input_file=None):

while True:
# In a loop get approved sequences uploaded to Github and upload to submission_table
github_username = os.getenv("GITHUB_USERNAME")
if not github_username:
github_username = config.github_username

github_pat = os.getenv("GITHUB_PAT")
if not github_pat:
github_pat = config.github_pat

response = requests.get(
config.github_url,
auth=HTTPBasicAuth(github_username, github_pat),
timeout=10,
)

Expand All @@ -123,7 +110,7 @@ def trigger_submission_to_ena(log_level, config_file, input_file=None):
error_msg = f"Failed to retrieve file: {response.status_code}"
logger.error(error_msg)
upload_sequences(db_config, sequences_to_upload)
time.sleep(30) # Sleep for 30seconds to not overwhelm github
time.sleep(60) # Sleep for 1min to not overwhelm github


if __name__ == "__main__":
Expand Down
10 changes: 0 additions & 10 deletions kubernetes/loculus/templates/ena-submission-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,6 @@ spec:
secretKeyRef:
name: ena-submission
key: password
- name: GITHUB_USERNAME
valueFrom:
secretKeyRef:
name: github-approval-repo
key: github-username
- name: GITHUB_PAT
valueFrom:
secretKeyRef:
name: github-approval-repo
key: github-pat
args:
- snakemake
- results/triggered
Expand Down
17 changes: 6 additions & 11 deletions kubernetes/loculus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1483,11 +1483,6 @@ secrets:
slack-hook: "dummy"
slack-token: "dummy"
slack-channel-id: "dummy"
github-approval-repo:
type: raw
data:
github-username: "dummy"
github-pat: "dummy"
ena-submission:
type: raw
data:
Expand Down Expand Up @@ -1564,9 +1559,9 @@ resources:
limits:
memory: "3Gi"
defaultResources:
requests:
memory: "200Mi"
cpu: "20m"
limits:
memory: "1Gi"
cpu: "20m"
requests:
memory: "200Mi"
cpu: "20m"
limits:
memory: "1Gi"
cpu: "20m"
6 changes: 0 additions & 6 deletions kubernetes/loculus/values_preview_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ secrets:
slack-hook: AgCLEhTwqKL278AbNwpqdRqeg6naNrQJWx3q8Zp+ecXjMaaLLBi1C3uQlt0WKioy+pUAhfe7MowXKLM55hLyh/InZ9o3yLi9T/5cVRXcEXCvODWmbhr94XhcYI3KnVngZLcNl9Gr4LR+bz8A0sl/rCij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S3modE+ElmCgBzi8gSQoVxXzmOIfMZRRwAaH0w==
github-approval-repo:
type: sealedsecret
clusterWide: "true"
encryptedData:
github-username: AgBtyXeimJmI7e1di9ubkzNODtAAlm0LiXEJJGfzzR/KExSrVMYsWcIIQOCfS/bbLvvvSyddKPGeFYhozG6CK943oTJ2rZHeMBjqtXX0AEw655KfJNgHWoWWk1xdmOzITtzKNlHi4cPcxswQte84NhJqRZPJ1sNhQfOm/AwL0NplQXD6xyl7UGAUKOW8rSLgH+gTUsTzmz2prgwiF3SmwwHCSClL/q9H4/nqkMycMQ5NcQK+5cpUUeWidzL3LjANCJS815S8oMdUWbDFwB3NPPfUhYdRuXM19MAHxq2hhAkn6rKGNI8tQhahi8dfmH2QDMyS1KVRof6taBXJIVMxeejL8nOJbNhPBdtyM+3hVasm/frLycUJxzvQpPPv1ictprM5K/r2sJDIqyXVOZSspyXQ09gFz2D13QsOSfaERbKUMtn9L0bfsG3N/zwo614N8YNCXf+dvIjVCoFwMD5RQ5IkqHLPEQiJ77++feSO+4fbfItjMI8qP4mM6YRI7VqweVKufwdSSropRpxhytnjqoWfvHFyDgzsw4ZuJwlyZs01yuJelog4yqG8WszWCv6Ae3fRM3gaquCj2UlFfxTBxN+aZId/lV3LCG1l06g82J6+YTL5wdCnYuYcpZmp21651J9jWwWzCumRWaQgbY6Ou0VjHKZ9if1uDdYA3S7SJJx/ZDZK4cixoS9VXgsPWFgmHbZNHqOFzOd2Dl9kRA==
github-pat: AgBa5wjYBw3GWXihWdoedx3oEbR5z808WoeIGyk5aAZPQ1MTMbWm4ZMdvJUZVPlkRacQXSt+A2pniYMjzl0bqHkc5guVQOoHu6jZgtyfaOyqT4Ergz1+L9VUzyn6E1NwqV2BtdKQTN7A1VvtLw0BLVG0E01SUcHeoU9MWlF+9BWFtXWWYxWL/sTLKoz0tnj8yu6LLHMMYeCnABAoZwZbJ3kf1UVp3FwcJbuSqsrUTPaeS6z5g90jL/zwJ150VUh9kInHs+kwV1imZp06ZUm3gpdY1f/EQZnxHTPUoaYLOo91cEhG7bSD9KQz1B6m07VzjIlnrwduPUCFQs1gk1hU7gO+6MYlMqCIb8NUQbuX5d5cHiENJm9DXAJdd8oNW02JQ371gulVYvXagAdrYgYv75Mr3YjejHZeinZrJ/ZxeZI0+fL4SLkh+77RyuN1R6ab1vGBoUG+LgHsUEBT7mw/wXtrzRmNBwxNBXSfTrrKM+EzM9KUsrSe490sK3Rf4TExjynL/9biS9ZFw601tdBh8luO3xFhCr8Bn4q7sWnKNmvSu+gMZklyhR65Hf0LHTxUdDcK8WZKFyds6foHTAv9kX4+NK7upVfAdjx9Tpf0ONad3nSboi/+1vYoGtAZcL6BZoNL+1Xu2WAlVa+WollJSV2k4KeTEswE1vmPAhoapyxpry9Mz+8CGkohvSPjHGdfXSNSW7K9zKCCubqzHV2+EsnaDWJ9+cwghAQFOpKdbJuHLwalMpAkTztRjr5wHfD6KSo1apCHZl84S0B2u8floEzU1XRiW8zq10m8cb3/xmdteNL3FNMlZlEieD2nsiU=
ena-submission:
type: sealedsecret
clusterWide: "true"
Expand Down

0 comments on commit 59aad25

Please sign in to comment.