-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from metabolomics-us/QA
FIEHNLAB-1600/FixSimilarityService,FIEHNLAB-1130/Documentation,Simplifying Deployment
- Loading branch information
Showing
35 changed files
with
424 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Build Proxy Prod" type="MavenRunConfiguration" factoryName="Maven"> | ||
<MavenSettings> | ||
<option name="myGeneralSettings" /> | ||
<option name="myRunnerSettings" /> | ||
<option name="myRunnerParameters"> | ||
<MavenRunnerParameters> | ||
<option name="profiles"> | ||
<set /> | ||
</option> | ||
<option name="goals"> | ||
<list> | ||
<option value="clean" /> | ||
<option value="install" /> | ||
<option value="-Denvironment=prod" /> | ||
</list> | ||
</option> | ||
<option name="pomFileName" value="pom.xml" /> | ||
<option name="profilesMap"> | ||
<map> | ||
<entry key="nexus" value="true" /> | ||
<entry key="test-jar" value="false" /> | ||
<entry key="doc-jar" value="false" /> | ||
<entry key="scala" value="true" /> | ||
<entry key="source-jar" value="false" /> | ||
<entry key="docker-proxy" value="false" /> | ||
<entry key="scala-test" value="false" /> | ||
<entry key="docker" value="true" /> | ||
</map> | ||
</option> | ||
<option name="resolveToWorkspace" value="false" /> | ||
<option name="workingDirPath" value="$PROJECT_DIR$/backend/app/server/proxy" /> | ||
</MavenRunnerParameters> | ||
</option> | ||
</MavenSettings> | ||
<method v="2" /> | ||
</configuration> | ||
<configuration default="false" name="Build Proxy Staging" type="MavenRunConfiguration" factoryName="Maven"> | ||
<MavenSettings> | ||
<option name="myGeneralSettings" /> | ||
<option name="myRunnerSettings" /> | ||
<option name="myRunnerParameters"> | ||
<MavenRunnerParameters> | ||
<option name="profiles"> | ||
<set /> | ||
</option> | ||
<option name="goals"> | ||
<list> | ||
<option value="clean" /> | ||
<option value="install" /> | ||
<option value="-Denvironment=staging" /> | ||
</list> | ||
</option> | ||
<option name="pomFileName" value="pom.xml" /> | ||
<option name="profilesMap"> | ||
<map> | ||
<entry key="nexus" value="true" /> | ||
<entry key="test-jar" value="false" /> | ||
<entry key="doc-jar" value="false" /> | ||
<entry key="scala" value="true" /> | ||
<entry key="source-jar" value="false" /> | ||
<entry key="docker-proxy" value="false" /> | ||
<entry key="scala-test" value="false" /> | ||
<entry key="docker" value="true" /> | ||
</map> | ||
</option> | ||
<option name="resolveToWorkspace" value="false" /> | ||
<option name="workingDirPath" value="$PROJECT_DIR$/backend/app/server/proxy" /> | ||
</MavenRunnerParameters> | ||
</option> | ||
</MavenSettings> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Deploy Proxy Prod" type="MavenRunConfiguration" factoryName="Maven"> | ||
<MavenSettings> | ||
<option name="myGeneralSettings" /> | ||
<option name="myRunnerSettings" /> | ||
<option name="myRunnerParameters"> | ||
<MavenRunnerParameters> | ||
<option name="profiles"> | ||
<set /> | ||
</option> | ||
<option name="goals"> | ||
<list> | ||
<option value="clean" /> | ||
<option value="deploy" /> | ||
<option value="-Denvironment=prod" /> | ||
</list> | ||
</option> | ||
<option name="pomFileName" value="pom.xml" /> | ||
<option name="profilesMap"> | ||
<map> | ||
<entry key="nexus" value="true" /> | ||
<entry key="test-jar" value="false" /> | ||
<entry key="doc-jar" value="false" /> | ||
<entry key="scala" value="true" /> | ||
<entry key="source-jar" value="false" /> | ||
<entry key="docker-proxy" value="false" /> | ||
<entry key="scala-test" value="false" /> | ||
<entry key="docker" value="true" /> | ||
</map> | ||
</option> | ||
<option name="resolveToWorkspace" value="false" /> | ||
<option name="workingDirPath" value="$PROJECT_DIR$/backend/app/server/proxy" /> | ||
</MavenRunnerParameters> | ||
</option> | ||
</MavenSettings> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Deploy Proxy Staging" type="MavenRunConfiguration" factoryName="Maven"> | ||
<MavenSettings> | ||
<option name="myGeneralSettings" /> | ||
<option name="myRunnerSettings" /> | ||
<option name="myRunnerParameters"> | ||
<MavenRunnerParameters> | ||
<option name="profiles"> | ||
<set /> | ||
</option> | ||
<option name="goals"> | ||
<list> | ||
<option value="clean" /> | ||
<option value="deploy" /> | ||
<option value="-Denvironment=staging" /> | ||
</list> | ||
</option> | ||
<option name="pomFileName" value="pom.xml" /> | ||
<option name="profilesMap"> | ||
<map> | ||
<entry key="nexus" value="true" /> | ||
<entry key="test-jar" value="false" /> | ||
<entry key="doc-jar" value="false" /> | ||
<entry key="scala" value="true" /> | ||
<entry key="source-jar" value="false" /> | ||
<entry key="docker-proxy" value="false" /> | ||
<entry key="scala-test" value="false" /> | ||
<entry key="docker" value="true" /> | ||
</map> | ||
</option> | ||
<option name="resolveToWorkspace" value="false" /> | ||
<option name="workingDirPath" value="$PROJECT_DIR$/backend/app/server/proxy" /> | ||
</MavenRunnerParameters> | ||
</option> | ||
</MavenSettings> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,85 @@ | ||
# README # | ||
# MassBank of North America Application | ||
|
||
ports for cluster service nodes: | ||
## Common: | ||
- Highly Recommended to use Linux OS (Preferably Ubuntu LTS 18.04 or 20.04) | ||
- Ensure you have the following installed | ||
- Node Version Manager(NVM) | ||
- Docker Engine (And Docker-Compose) | ||
- NPM (Node Package Manager) | ||
- Angular CLI 10.2.3 | ||
- IntelliJ IDEA Ultimate | ||
- Maven 3 (Should be baked into IntelliJ) | ||
- Git | ||
- AWS CLI (for ECR to pull docker images) | ||
- Java 1.8_292 (open_jdk x64) | ||
- Scala 2.13 | ||
- Installs in IntelliJ | ||
- Right-click the main 'mona' project and click 'Add Framework Support' | ||
- Gain Access to the following | ||
- Internal mona-config private repo | ||
- You'll need admin access and will need to generate a Personal Access Token (https://github.com/settings/tokens) | ||
- Then open your `~/.bash_rc` and set the following variables, 'GIT_USER' and 'GIT_PASS' to your github username and | ||
new personal access token. This allows the discovery service to work as intended | ||
- Note: You'll need to set these tokens on the IPA and GOSE servers as they expire every year (you can configure | ||
how quickly these expire). | ||
- Access to AWS account and ability to push to ECR | ||
- Admin access to public mona repo | ||
- You'll need a settings.xml file for your maven 'User Settings File' this will include the nexus profile | ||
and all the necessary repo's for pulling down libraries. Please ask a developer on the team for this config | ||
and store file at `~/.m2` | ||
|
||
|
||
## Starting Development: | ||
- There are 3 scripts in the project to easily start development | ||
- `./start_corsproxy.sh` | ||
- Solves CORS issues when connecting the frontend to the microservices | ||
- `./start_docker_dev.sh` | ||
- Starts all necessary docker microservices | ||
- `./start_frontend.sh` | ||
- Starts the Angular 10 frontend with ng serve to develop on the fly | ||
|
||
## PROD Deployment: | ||
- Production deployment is simple with docker | ||
- Bring down the application with: `docker stack rm mona` | ||
- Bring the application back up with `docker stack deploy -c docker-compose-prod.yml` | ||
- Note: You may need to force the newest images to pull down with `docker-compose -f docker-compose-prod.yml pull` | ||
|
||
## Running Test Suite With IntelliJ and Maven: | ||
- Using the built-in Maven tab, we can run the full scala test suite | ||
- Make sure the following Maven profiles are selected (and only those): nexus, scala, scala-test | ||
- Run the following docker-compose file: `docker-compose -f docker-compose-test.yml -d` | ||
- Finally, run `mvn clean install` on the 'backend(root)' | ||
|
||
## Generate new Docker Images: | ||
- Make sure the following Maven profiles are selected (and only those): nexus, scala, docker | ||
- The following services can be built into docker images: discovery, bootstrap, webhooks-server,curation-scheduler, | ||
repository, persistence-server, auth-server, similarity, proxy, download-scheduler, and curation-runner | ||
- `mvn clean install` will build a local docker image for the corresponding service | ||
- `mvn clean deploy` will build the docker image and deploy it to ECR (make sure you signed in to AWS CLI) | ||
- default tag is 'test' you can easily configure that in the main mona pom.xml | ||
- NOTE: For the proxy service pom.xml, you'll need to configure the 'ng.env' variable to 'staging' or 'prod' | ||
depending on if the build is for IPA('staging') or GOSE('prod'); | ||
|
||
## Important Development Notes: | ||
- Make sure project sdk/jdk is set to Java 1.8_292 | ||
- Make sure to configure Maven in IntelliJ IDEA to use the same project jdk which should be Java 1.8_292 | ||
- Make sure you added framework support for scala 2.13 in IntelliJ for the mona project | ||
- When making a new branch for git, naming convention should typically have a ticket number (i.e. FIEHN-1234) following | ||
a slash and a description of the ticket (i.e. FIEHN-1234/ThisIsATicket). | ||
- If your having issues pulling packages with maven, you can troubleshoot with deleting your `~/.m2/repository` directory. | ||
Additionally, ensure you have the correct 'settings.xml' file in `~/.m2`. If problems still persist, try the 'Invalidate | ||
Caches' under File tab in IntelliJ IDEA. | ||
|
||
|
||
### ports for cluster service nodes: | ||
- persistence svr: 2222 | ||
- configuration svr: 1111 | ||
- discovery service: 8761 | ||
- auth server: 3333 | ||
- proxy service: 8080 (entry point) | ||
|
||
|
||
ports for in-memory node: | ||
### ports for in-memory node: | ||
- embedded mongo db: 27017 | ||
- mona rest client: 8080 | ||
- elasticsearch client: 9200 | ||
- elasticsearch web???: 9300 | ||
|
||
Building the nodes: | ||
|
||
Common: | ||
- check/setup docker configuration | ||
for Mac/Win: | ||
eval "$(docker-machine env default)" | ||
for linux: | ||
N/A | ||
- run 'mvn clean install' on the backend folder to compile and create the docker images | ||
|
||
To run the in-memory node docker continer: | ||
- To create the containers manually: | ||
run 'docker run [--name <whateveryouwanttonameyourimage>] -p=80:8080 [-p=9200:9200 -p=9300:9300 -p=27017:27017] eros.fiehnlab.ucdavis.edu/mona-memory-node' | ||
to start the docker container of choice | ||
|
||
To run the cluster service nodes using docker compose: (WIP) | ||
- To run the cluster node using docker-compose: | ||
'cd app/compose' | ||
run 'docker-compose up -d' | ||
|
||
- elasticsearch web: 9300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.