From c315867a308836b2933eb40e2ae809c8dd316833 Mon Sep 17 00:00:00 2001 From: Jeffrey Thiessen Date: Tue, 15 Nov 2022 12:14:47 -0600 Subject: [PATCH 1/2] quality of life updates --- .gitignore | 3 ++- CHANGELOG.md | 1 + doc/developer/setup/index.md | 50 ++++++++++++++++++++++++++++++++---- gradle.properties | 8 ++++++ 4 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 gradle.properties diff --git a/.gitignore b/.gitignore index cfa8596e02b..0abcc2e5398 100644 --- a/.gitignore +++ b/.gitignore @@ -55,4 +55,5 @@ src/main/webapp/node_modules ### MISC ### /.theia/launch.json *.swp -/src/main/resources/application-local.properties \ No newline at end of file +/src/main/resources/application-local.properties +java_pid*.hprof diff --git a/CHANGELOG.md b/CHANGELOG.md index edf457a85a5..b5db55feb7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ # Changelog ## [Unreleased] +* [Developer] Updated developer setup documentation, ignore java_pid*.hprof files, and added quality of life file `gradle.properties` ## [22.09.4] - 2022/11/14 * [REST]: Fixed issue with project/samples api response missing samples when a sample has a default sequencing object. See [PR 1413](https://github.com/phac-nml/irida/pull/1413) diff --git a/doc/developer/setup/index.md b/doc/developer/setup/index.md index 083bda3060c..0b768083432 100644 --- a/doc/developer/setup/index.md +++ b/doc/developer/setup/index.md @@ -78,15 +78,47 @@ IRIDA is configured to use the following credentials by default: You'll need to permit those user credentials to create the tables in the database. A quick one-liner for that is: - echo "grant all privileges on irida_test.* to 'test'@'localhost' identified by 'test';" | mysql -u root -p +``` +# Create the 'test' user: +echo "CREATE USER 'test'@'localhost' IDENTIFIED BY 'test';" | mysql -u root -p -Also create the database if it doesn't exist: +# Create the database if it doesn't exist: +echo "create database irida_test;" | mysql -u root -p - echo "create database irida_test;" | mysql -u root -p +# Grand 'test' user permissions to database: +echo "grant all privileges on irida_test.* to 'test'@'localhost';" | mysql -u root -p +``` -In order to run local integration tests, the database `irida_integration_test` is used instead. This database requires permissions from user `'test'@'localhost'`. To grant such permissions a quick one-liner is: +In order to run local integration tests, the same steps need to be performed for the database name `irida_integration_test` +``` +# Create the database if it doesn't exist: +echo "create database irida_integration_test;" | mysql -u root -p + +# Grand 'test' user permissions to database: +echo "grant all privileges on irida_integration_test.* to 'test'@'localhost';" | mysql -u root -p +``` + +### Configure Docker + +IRIDA uses Docker to create galaxy instances when running integration tests. + +https://docs.docker.com/engine/install/ubuntu/ + +You will also need to ensure your user has permissions to run docker commands. Please note that doing this effectively gives your user root access, so this should only be done in development environments. + +``` +# Create the docker group if it does not exist +sudo groupadd docker +# Add your user to the docker group. +sudo usermod -aG docker $USER +# login to docker group so you don't have to sign in/out +newgrp docker +# restart docker +sudo systemctl restart docker +# test that you can create docker instances +docker run hello-world +``` - echo "grant all privileges on irida_integration_test.* to 'test'@'localhost';" | mysql -u root -p ### Configure Filesystem Locations @@ -143,6 +175,14 @@ To run the full integration test suite for IRIDA please run the following: This will run all the integration test profiles using Gradle, and print out reports for each profile. +#### Memory requirements + +Your environment may throw java heap size errors when running tests. + +You can increase the heap size by editing the `gradle.properties` file in the project directory and adding the following line: + +`org.gradle.jvmargs=-Xmx4096m` + Setting up Galaxy ----------------- diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000000..521e750c2ab --- /dev/null +++ b/gradle.properties @@ -0,0 +1,8 @@ +# Project-wide Gradle settings. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# org.gradle.jvmargs=-Xmx4096m From f07d4fd009bcc7b3d38bd7825dfbb2bb6330b927 Mon Sep 17 00:00:00 2001 From: Jeffrey Thiessen Date: Wed, 16 Nov 2022 15:21:56 -0600 Subject: [PATCH 2/2] added gradle.properties to .gitignore --- .gitignore | 1 + doc/developer/setup/index.md | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index 0abcc2e5398..942c885c657 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,4 @@ src/main/webapp/node_modules *.swp /src/main/resources/application-local.properties java_pid*.hprof +gradle.properties diff --git a/doc/developer/setup/index.md b/doc/developer/setup/index.md index 0b768083432..b734ff92a4e 100644 --- a/doc/developer/setup/index.md +++ b/doc/developer/setup/index.md @@ -183,6 +183,14 @@ You can increase the heap size by editing the `gradle.properties` file in the pr `org.gradle.jvmargs=-Xmx4096m` +Another method is to set the environment variable + +`env GRADLE_OPTS='-Xmx4096m'` + +And then running the following to kill active daemons to apply the change + +`./gradlew --stop` + Setting up Galaxy -----------------