Skip to content
Snippets Groups Projects
Maksym Tishchenko's avatar
Maksym Tishchenko authored
NameGroup v2 updates

See merge request grin-global/grin-global-ui!737
e9dc94f5
History

GRIN-Global Client

Please visit https://gitlab.croptrust.org/grin-global/support for assistance.

The GRIN-Global Client is a set of tools for genebank technicians, curators and managers to interact with the GGCE Server APIs.

Please check https://gitlab.croptrust.org/grin-global/support for GGCE information!

Running GGCE Web

GGCE Web is available as a Docker image dockerhub.croptrust.org/grin-global/grin-global-ui/gg-ce-web:latest. It works best with GGCE Server image dockerhub.croptrust.org/grin-global/grin-global-server:latest. Please update your local images with:

docker pull dockerhub.croptrust.org/grin-global/grin-global-server:latest
dockerhub.croptrust.org/grin-global/grin-global-ui/gg-ce-web:latest

The GGCE Web container requires a few configuration options. The options are provided as environment variables. You need to note:

Variable Description
FRONTEND_URL The URL of the GGCE Web service (e.g. https://ggce.server.lan). This will be the same as the FRONTEND_URL variable of your gg-ce-server container.
API_URL The URL to the GGCE Server (e.g. https://api.server.lan). This should match the host name (including port, if not default) where gg-ce-server is accessible to users.
CLIENT_ID and CLIENT_SECRET OAuth Client credentials (or skip to use default values) used by gg-ce-web to authenticate against the API server.
NAME Give your GGCE instance a name.
ALLOW_ROBOTS Set to true if a request to /robots.txt should respond with Allow. Defaults to false to inform robots that their requests are not wanted.

Start GGCE Server as a Docker container:

# You must specify the memory allocated to the container using the --memory flag.
# Windows: Remove the \ from the command below when using cmd.exe!
docker run --name 'ggce-ui' \
 --memory 500m \
 -p 3000:3000 \
 -e "NAME=Genebank Information System"
 -e "API_URL=http://${YOUR_DOCKER_HOST_IP}:8081" \
 -e "FRONTEND_URL=http://${YOUR_DOCKER_HOST_IP}:3000" \
 dockerhub.croptrust.org/grin-global/grin-global-ui/gg-ce-web:latest

Note: After hitting Enter You should immediately seeing log messages on the console. If not, then your command is not valid. Hit Ctrl + C and retry.

GGCE Web internally listens on port 3000. The -p 3000:3000 flag above instructs docker to expose the internal port 3000 on port 3000 on the host. This makes the GGCE web interface accessible at http://YOUR_DOCKER_HOST_IP:3000 and you can use a proxy to route web traffic to the container.

Configuration examples

The server and web containers will usually run behind a proxy. The actual URLs at which GGCE services are accessible must be specified in the container configuration.

Case 1

Services are accessible on different hosts, API server is accessible at https://service.institute.lan and GGCE Web at https://web.genebank.lan.

Setting Value
API_URL https://service.institute.lan API service URL
FRONTEND_URL https://web.genebank.lan Web UI accessible on a different URL

Case 2

Both services use the same host name, but are accessible on different virtual paths: API server is accessible at https://genebank.lan and GGCE Web at https://genebank.lan/gg-ce.

Setting Value
API_URL https://genebank.lan The API URL includes the virtual path
FRONTEND_URL https://genebank.lan/gg-ce Web UI is accessioble on a different URL and includes a virtual path

Case 3

API server is accessible at https://web.genebank.lan/server and GGCE Web is at https://web.genebank.lan.

Note: Hosting the API server on a virtual path breaks compatibility with the Curator Tool.

Setting Value
API_URL https://web.genebank.lan/server The API URL includes the virtual path
FRONTEND_URL https://web.genebank.lan Web UI is accessioble on a different URL

Troubleshooting

The effecive configuration is printed out immediately when you start the gg-ce-web container.

The Application config section (example below) displays the values in use. These need to be properly configured with Docker environment variables.

Running Genesys UI from /var/www/gg-ce with CLIENT_ID= and API at 
Starting on TCP port  (default 3000).
2020-07-15T15:29:04: PM2 log: Launching in no daemon mode
2020-07-15T15:29:04: PM2 log: App [gg-ce:0] starting in -cluster mode-
2020-07-15T15:29:04: PM2 log: App [gg-ce:0] online
{
  _: [ 'start', 'gg-ce.yml' ],
  'origin': '',
  'api-timeout': '',
  'api-url': '',
  'client-id': '',
  'client-secret': '',
  'allow-robots': ''
}
Application config {
  origin: 'http://localhost:3000',
  apiTimeout: 10000,
  apiUrl: 'http://localhost:8080',
  clientId: 'defaultclient@localhost',
  clientSecret: 'changeme',
  allowRobots: false
}

Next release

The preview of the next release is available as dockerhub.croptrust.org/grin-global/grin-global-ui/gg-ce-web:edge and you should update your copy of the image before restarting your container:

docker image pull dockerhub.croptrust.org/grin-global/grin-global-ui/gg-ce-web:edge

Development environment

node and yarn are required for GGCE UI development.

Run yarn install in the project root directory.

In case of build errors please run yarn --check-files --ignore-scripts in the project root directory.

Running dev server with hot reload

To start the web application with live-reload server and work on the application, run yarn run start:dev in workspaces/ui-express module directory

This starts the webpack-dev-server on port 3000: http://localhost:3000/

Running SSR server

To start express server with server side rendering and test application as in staging environment yarn run start:prod in workspaces/ui-express module directory

This starts the express server on port 3000: http://localhost:3000/

Running tests

To start test yar run test in root directory, or yarn run test in workspaces/ui-core module directory

This starts jest test runner with code coverage statistics

License and Disclaimer

This software is licensed under the Apache License, Version 2.0 (the "License").

You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.