diff --git a/CHANGELOG.md b/CHANGELOG.md index eef2e72..bf5c81a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added ### Changed -- issue-58: Changed harmony submit call from GET to POST. ### Removed ### Fixed - issue-72: Fixed multipart form data for harmony submit. diff --git a/README.md b/README.md index a841288..58e43c6 100644 --- a/README.md +++ b/README.md @@ -30,4 +30,116 @@ Subset-Job related endpoints: ## Connections to other systems * Earthdata Login system * MySQL/MariaDB database -* PODAAC L2SS services \ No newline at end of file +* PODAAC L2SS services + +## Local development + +### 1. Setting Up MySQL with Docker + +#### Step 1: Pull the MySQL Docker Image + +Make sure you have Docker installed on your system. Then, pull the MySQL version 5 Docker image: + +```bash +docker pull --platform linux/x86_64 mysql +docker pull mysql:5 +``` + +#### Step 2: Run the MySQL Docker Container + +Run a MySQL container with the desired configuration: + +```bash +docker run --name hitide-mysql --platform linux/amd64 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d -p 3306:3306 mysql:5 +``` + +You can customize: + +- `--name hitide-mysql`: The name of the Docker container. +- `-e MYSQL_ROOT_PASSWORD=my-secret-pw`: The root password for MySQL. +- `-p 3306:3306`: The port mapping, which maps port 3306 on your host to port 3306 in the container. + +#### Step 3: Verify the MySQL Container is Running + +Check the status of the running container: + +```bash +docker ps +``` + +You should see your MySQL container listed. + +### 2. Creating the Database + +#### Step 1: Connect to the MySQL Instance + +Use your preferred MySQL client or the MySQL command-line tool to connect to the running MySQL instance: + +```bash +mysql -h 127.0.0.1 -P 3306 -u root -p +``` + +You'll be prompted for the root password (my-secret-pw in this case). + +#### Step 2: Create the Database + +Once connected, create the database: + +```sql +CREATE DATABASE hitide_profile; +``` + +### 3. Setting Up the Application + +#### Step 1: Configure Environment Variables + +Before running the setup script, configure the necessary environment variables. You can set these variables in your shell session or use a `.env` file. Here’s an example of how to set them: + +```bash +export DATABASE_HOST=127.0.0.1 +export DATABASE_PORT=3306 +export DATABASE_NAME=hitide_profile +export DATABASE_ADMIN=root +export DATABASE_ADMIN_PASSWORD=my-secret-pw +export DATABASE_USERNAME=hitide_user +export DATABASE_PASSWORD=hitide_password +``` + +#### Step 2: Run the Setup Script + +Navigate to the hitide-profile root directory and run the setup script: + +```bash +cd path/to/hitide-profile +node mysql/setup-db.js +``` + +This script will: +- Connect to the MySQL instance using the admin credentials. +- Create a new user (specified by `DATABASE_USERNAME` and `DATABASE_PASSWORD`). +- Set up the necessary tables in the `hitide_profile` database. + +### 4. Verifying the Setup + +#### Step 1: Check Database and Tables + +Reconnect to the MySQL instance and check the database and tables: + +```bash +mysql -h 127.0.0.1 -P 3306 -u root -p +``` + +Then run: + +```sql +USE hitide_profile; +SHOW TABLES; +``` + +You should see the tables created by the setup script. + +### Note: +In HiTIDE UI code in the **hitideConfig.js** file, make sure you set the **hitideProfileOrigin** variable to where your local hitide-profile instance is running so the frontend knows where to find hitide-profile. For example: +``` +var hitideProfileOrigin = "http://localhost:8080/hitide/api"; +``` \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5b5621f..78af6be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2882,6 +2882,29 @@ } } }, + "node_modules/eslint-scope": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.2.tgz", + "integrity": "sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "7.12.0", + "@typescript-eslint/types": "7.12.0", + "@typescript-eslint/typescript-estree": "7.12.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, "node_modules/eslint-scope": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.2.tgz", @@ -3247,6 +3270,30 @@ "node": ">=8.6.0" } }, + "node_modules/fast-glob/node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fast-glob/node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/fast-glob/node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -3260,6 +3307,40 @@ "node": ">= 6" } }, + "node_modules/fast-glob/node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/fast-glob/node_modules/micromatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "dev": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/fast-glob/node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -4189,6 +4270,65 @@ } } }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-config/node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-config/node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/jest-config/node_modules/micromatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "dev": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/jest-config/node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, "node_modules/jest-diff": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", @@ -5195,6 +5335,22 @@ "dev": true, "license": "MIT" }, + "node_modules/nodemon/node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, "node_modules/nodemon/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -5914,9 +6070,6 @@ "license": "ISC", "bin": { "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" } }, "node_modules/send": { @@ -6738,6 +6891,11 @@ "node": ">= 6" } }, + "node_modules/winston/node_modules/async": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==" + }, "node_modules/winston/node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", diff --git a/server/client/harmony.js b/server/client/harmony.js index 5f85d45..ab5a1a8 100644 --- a/server/client/harmony.js +++ b/server/client/harmony.js @@ -9,6 +9,7 @@ async function subset(job, accessToken) { datasetId, bbox, granuleIds = [], + granuleNames = [], variables, merge, } = job.subjobs[0];