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

[IT-3230] Move agora data manager CI #116

Merged
merged 13 commits into from
Jan 5, 2024

Conversation

zaro0508
Copy link
Member

@zaro0508 zaro0508 commented Jan 3, 2024

Move agora data manager from using travis CI to Github actions CI. This move also changes the update workflow to us github self-hosted runners which will be much more secure.

depends on Sage-Bionetworks-IT/organizations-infra#1060

Move agora data manager from using travis CI to Github actions CI.
This move also changes the update workflow to not require an AWS
bastion host which will be much more secure. Another benefit is
that it's also a more simple setup.
@zaro0508 zaro0508 requested review from a team, JessterB and sagely1 January 3, 2024 18:24
zaro0508 added a commit to zaro0508/agora2-infra that referenced this pull request Jan 3, 2024
Once we setup DB updates from github instances we will no longer
need an AWS bastian host for each environment.

depends on Sage-Bionetworks/agora-data-manager#116
@xschildw
Copy link

xschildw commented Jan 3, 2024

Is the DB_HOST in a public subnet? In import-data.sh, I see mongoimport connects to it directly from the runner, correct?

@zaro0508
Copy link
Member Author

zaro0508 commented Jan 3, 2024

Is the DB_HOST in a public subnet? In import-data.sh, I see mongoimport connects to it directly from the runner, correct?

no, the db host is in a private subnet. The GH runner has access to it via PR Sage-Bionetworks-IT/organizations-infra#1060

@zaro0508 zaro0508 requested a review from xschildw January 3, 2024 22:46
@xschildw
Copy link

xschildw commented Jan 3, 2024

The GH runner has the right to make AWS API calls to setup DocumentDB. Should not mongoimport try to connect to the DB_HOST with the DB_USER/PWD creds? If so DB_HOST will resolve to a private IP address and it will not be able to find the host (I assume it works like an RDS setup).

@zaro0508
Copy link
Member Author

zaro0508 commented Jan 3, 2024

The GH runner has the right to make AWS API calls to setup DocumentDB. Should not mongoimport try to connect to the DB_HOST with the DB_USER/PWD creds? If so DB_HOST will resolve to a private IP address and it will not be able to find the host (I assume it works like an RDS setup).

Argg! you are correct @xschildw. Will need to rethink this whole setup.

@zaro0508
Copy link
Member Author

zaro0508 commented Jan 4, 2024

I was thinking that an alternative solution would be to setup AWS CLI + aws-session-manager to execute those mongo commands however it appears that AWS does not support running session manager agent on RDS instances, https://repost.aws/questions/QU9-N7fbk-SLOZvegK63XrRw/using-session-manager-to-connect-rds-without-having-ec2-instance

The only other alternative i can think of is to use GH custom runners but i’m not a fan of that solution because it requires a bit of manual configuration to setup.

@zaro0508
Copy link
Member Author

zaro0508 commented Jan 5, 2024

Changed to use GH self hosted runners

Copy link

@xschildw xschildw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you setup the runners?

@zaro0508
Copy link
Member Author

zaro0508 commented Jan 5, 2024

How did you setup the runners?

i added some more docs around that topic but mostly just followed instructions from the github documentation.

@zaro0508 zaro0508 requested a review from xschildw January 5, 2024 17:25
README.md Show resolved Hide resolved
zaro0508 added a commit to zaro0508/agora2-infra that referenced this pull request Jan 5, 2024
The bastian security group allow SSH access.  We can now
close that access by setting up self hosted runners
in GH actions.  This will make the hosts more secure.

depends on Sage-Bionetworks/agora-data-manager#116
@zaro0508 zaro0508 merged commit 64a0435 into Sage-Bionetworks:develop Jan 5, 2024
3 checks passed
zaro0508 added a commit to Sage-Bionetworks/agora2-infra that referenced this pull request Jan 5, 2024
The bastian security group allow SSH access.  We can now
close that access by setting up self hosted runners
in GH actions.  This will make the hosts more secure.

depends on Sage-Bionetworks/agora-data-manager#116
zaro0508 added a commit to Sage-Bionetworks-IT/organizations-infra that referenced this pull request Jan 5, 2024
Revert creation of a role for GH OIDC because our plan shifted to using self-hosted runner insteead of a GH runner.  A role is not needed when using self-hosted runners because the self hosted runner is already setup with access to the databases.

more info in PR Sage-Bionetworks/agora-data-manager#116

This reverts commit d1f91e1 and  commit a6406aa.
zaro0508 added a commit to zaro0508/agora2-infra that referenced this pull request Jan 8, 2024
We switch to using GH self hosted runner therefore the bastian
hosts do not need to be accessible from the internet anymore.

depends on Sage-Bionetworks/agora-data-manager#116
zaro0508 added a commit to Sage-Bionetworks/agora2-infra that referenced this pull request Jan 9, 2024
We switch to using GH self hosted runner therefore the bastian
hosts do not need to be accessible from the internet anymore.

depends on Sage-Bionetworks/agora-data-manager#116
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants