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

Changes for Fargate Dockstore deploy #225

Merged
merged 12 commits into from
May 26, 2022
Merged

Conversation

kathy-t
Copy link
Contributor

@kathy-t kathy-t commented May 17, 2022

SEAB-4096

This PR introduces changes that are needed by the Fargate Dockstore stack (https://github.com/dockstore/dockstore-deploy/pull/478).

I added a IS_FARGATE_DEPLOY key which allows install_bootstrap to create the config files in a way that can be used by the fargate deploy. The regular docker-compose deploy should be unaffected.

Changes:

  • Config files for Fargate deploy have to be placed in more specific directories to avoid having all the config files in one volume
  • The gitHubAppPrivateKeyFile path is slightly changed in web.yml
  • In templates/default.nginx_http.conf.template, $webservice is set to 127.0.0.1 for Fargate deploy because containers that belong to the same task can communicate over the localhost interface.
  • Specified an absolute path to the webservice jar in init_migrations and init_webservice because the respective scripts are not in the same directory as the jar

@kathy-t kathy-t self-assigned this May 17, 2022
Copy link
Member

@denis-yuen denis-yuen left a comment

Choose a reason for hiding this comment

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

(this part) seems straightforward but was curious

docker-compose.yml Show resolved Hide resolved
Copy link
Contributor

@coverbeck coverbeck left a comment

Choose a reason for hiding this comment

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

Some curiosity questions, but looks good to me, in so far as I (don't) understand Fargate.

docker-compose.yml Show resolved Hide resolved
@@ -2,6 +2,6 @@

cd "$(dirname "$0")"

java -XX:MaxRAMPercentage=50.0 -XX:+ExitOnOutOfMemoryError -jar dockstore-webservice-*.jar server web.yml | tee --append /dockstore_logs/webservice.out
java -XX:MaxRAMPercentage=50.0 -XX:+ExitOnOutOfMemoryError -jar /home/dockstore-webservice-*.jar server web.yml | tee --append /dockstore_logs/webservice.out
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the 50% is a holdover from when we had ElasticSearch and Postgres running on the same machine. We probably should have raised this for EC2 (and could maybe have brought down the instance size in conjunction with that).

But not to digress from the Fargate PR, that could be tackled separately... Should we be setting this at all for Fargate? I don't know, just asking.

Copy link
Member

Choose a reason for hiding this comment

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

Hmmm, also Nextflow but yes. I suspect we can tune this for Fargate with some performance testing.
It probably should be a spin-off ticket to be tackled, much later.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, right forgot about Nextflow... we probably don't want to go too much higher after all, at least not in the EC2 world.

install_bootstrap Show resolved Hide resolved
@kathy-t
Copy link
Contributor Author

kathy-t commented May 18, 2022

Marking this as ready for review because the corresponding dockstore-deploy PR https://github.com/dockstore/dockstore-deploy/pull/478 is ready for review

@kathy-t kathy-t marked this pull request as ready for review May 18, 2022 20:50
@@ -4,12 +4,12 @@
cd "$(dirname "$0")"

{{#DATABASE_GENERATED}}
java -Ddw.database.user=postgres -Ddw.database.password="{{{ POSTGRES_DBPASSWORD }}}" -jar dockstore-webservice-*.jar db migrate web.yml --include 1.3.0.generated,1.3.1.consistency,1.4.0,1.5.0,1.6.0,1.7.0 | tee --append /dockstore_logs/webservice.out
java -Ddw.database.user=postgres -Ddw.database.password="{{{ POSTGRES_DBPASSWORD }}}" -jar /home/dockstore-webservice-*.jar db migrate web.yml --include 1.3.0.generated,1.3.1.consistency,1.4.0,1.5.0,1.6.0,1.7.0 | tee --append /dockstore_logs/webservice.out
Copy link
Contributor

Choose a reason for hiding this comment

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

Related to comments in #483, the /home directory should not contain anything except home directories for users on the system. This jar should be in /home/<username>/. (probably ubuntu, but not sure what kind of container this script is being run in).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is in the /home directory because the webservice Dockerfile put it there: https://github.com/dockstore/dockstore/blob/develop/Dockerfile#L19. The docker-compose file also puts things in the /home directory: https://github.com/dockstore/compose_setup/blob/develop/docker-compose.yml#L25. Should I be making changes to fix that?

Copy link
Member

Choose a reason for hiding this comment

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

FWIW, the home directory thing is Linux best practice. That said, since this seems to be already in use in our various environments (and for a while), I would split this out the a new ticket to use /home properly and systematically (not 100% sure, it makes sense for Docker anyway)

@@ -29,7 +29,7 @@ zenodoUrl: {{ ZENODO_URL }}
orcidClientID: {{ ORCID_CLIENT_ID }}
orcidClientSecret: {{ ORCID_CLIENT_SECRET }}

gitHubAppPrivateKeyFile: /home/dockstore_github_app_private_key.pem
gitHubAppPrivateKeyFile: /home/github-key/dockstore-github-private-key.pem
Copy link
Contributor

@chmreid chmreid May 19, 2022

Choose a reason for hiding this comment

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

The way this reads, you have a user named github-key and the only reason they exist is so their home directory can contain a .pem key. The problem is, /home/ is being used as a home directory, but the home directory should be /home/<username>.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed this to the /dockstore/github-key directory: 587358c

@kathy-t kathy-t requested a review from chmreid May 25, 2022 15:26
@kathy-t kathy-t merged commit 2959c8b into develop May 26, 2022
@kathy-t kathy-t deleted the feature/seab-4096/cdk-fargate branch May 26, 2022 17:25
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.

7 participants