Skip to content

Commit

Permalink
merging block 3 pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
gottacatchenall committed Oct 7, 2023
2 parents bba099b + 0d0dce0 commit 25921cd
Show file tree
Hide file tree
Showing 21 changed files with 1,158 additions and 122 deletions.
55 changes: 28 additions & 27 deletions .github/workflows/docker_ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,36 @@ on:
branches:
- main
paths:
- 'ui/**'
- "ui/**"

jobs:
ui:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: geobon/bon-in-a-box
tags: |
type=raw,value=ui
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: ui
file: ui/Dockerfile.prod
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- run: echo REACT_APP_VIEWER_HOST=/viewer >> ui/.env

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: geobon/bon-in-a-box
tags: |
type=raw,value=ui
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: ui
file: ui/Dockerfile.prod
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A GEO BON project, born from a collaboration between Microsoft, McGill, Humbolt
## Contributing
If you wish to contribute your indicator or EBV code, please let us know at [email protected].

The recommended method is to setup an instance of BON in a Box somewhere you can easily play with the script files, using the local or remote setup below. You can create a fork to save your work. Make sure that the code is general, and will work when used with various parameters, such as in different regions around the globe. Once the integration of the new scripts or pipelines are complete, open a pull request to this repository. The pull request will be peer-reviewed before acceptation.
The recommended method is to setup an instance of BON in a Box somewhere you can easily play with the script files, using the local or remote setup below. You can create a branch or fork to save your work. Make sure that the code is general, and will work when used with various parameters, such as in different regions around the globe. Once the integration of the new scripts or pipelines are complete, open a pull request to this repository. The pull request will be peer-reviewed before acceptation.

## Running the servers locally
Prerequisites :
Expand Down Expand Up @@ -73,6 +73,13 @@ When modifying pipelines in the /pipelines folder, servers do not need to be res
3. Create a .env file on the server, as above.
4. Take dockers down and up to load the .env file (this allows accessing GBIF, etc.)
## Running a script or pipeline
You have an instance of BON in a Box running, either [locally](#running-the-servers-locally) or [remotely](#running-the-servers-remotely), and you want to run your first script or pipeline.
There is one page to run scripts, and one to run pipelines. Select the script or pipelines from the dropdown and fill the form.
The form might ask you for a file. In order to provide a file that you own locally, upload or copy it to the `userdata` folder. You can then refer to it with a url as such: `userdata/myFile.shp`, or `userdata/myFolder/myFile.shp` if there are subfolders.
## Scripts
The scripts perform the actual work behind the scenes. They are located in [/scripts folder](/scripts)
Expand Down
15 changes: 8 additions & 7 deletions compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@
version: "3.7"

services:
## UI server to use when developing UI code
## UI server to use when developing UI code
ui:
container_name: biab-ui
build:
context: ./ui
dockerfile: Dockerfile.dev
user: "node"
volumes:
- './ui:/app:rw'
- "./ui:/app:rw"
working_dir: "/app"
command: sh -c "cd BonInABoxScriptService; npm run build; cd -; npm install; npm start;"
expose:
- '3000'
- "3000"
environment:
- CHOKIDAR_USEPOLLING=true
- CHOKIDAR_USEPOLLING=true
# https://github.com/facebook/create-react-app/issues/11779
- WDS_SOCKET_PORT=0
- REACT_APP_VIEWER_HOST=${REACT_APP_VIEWER_HOST}
depends_on:
- script-server
- tiler
Expand All @@ -31,8 +32,8 @@ services:
- ui
- openapi_swagger

## In the DEV version, using a volume and a single docker. To rebuild without restarting everything, use
## docker exec -it biab-script-server sh -c "cd /home/gradle/project/ && gradle build"
## In the DEV version, using a volume and a single docker. To rebuild without restarting everything, use
## docker exec -it biab-script-server sh -c "cd /home/gradle/project/ && gradle build"
script-server:
build:
context: ./script-server
Expand All @@ -44,7 +45,7 @@ services:
environment:
DEV: true

## Server to use when making changes to the OpenAPI specification.
## Server to use when making changes to the OpenAPI specification.
openapi_swagger:
container_name: swagger_editor
image: swaggerapi/swagger-editor
Expand Down
7 changes: 7 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ services:
volumes:
- ./scripts:/scripts:ro
- ./pipelines:/pipelines:ro
- ./userdata:/userdata:ro
- ./output:/output:rw
- /var/run/docker.sock:/var/run/docker.sock
expose:
- "8080"
environment:
- SCRIPT_LOCATION=/scripts
- USERDATA_LOCATION=/userdata
- PIPELINES_LOCATION=/pipelines
- OUTPUT_LOCATION=/output
- HOST_PATH=${PWD}
Expand All @@ -37,9 +39,11 @@ services:
tty: true # Needed to keep the container alive, waiting for requests.
volumes:
- ./scripts:/scripts:ro
- ./userdata:/userdata:ro
- ./output:/output:rw
environment:
- SCRIPT_LOCATION=/scripts
- USERDATA_LOCATION=/userdata
- OUTPUT_LOCATION=/output
- JUPYTERHUB_API_TOKEN=${JUPYTERHUB_API_TOKEN}
- GBIF_USER=${GBIF_USER}
Expand All @@ -57,9 +61,11 @@ services:
tty: true # Needed to keep the container alive, waiting for requests.
volumes:
- ./scripts:/scripts:ro
- ./userdata:/userdata:ro
- ./output:/output:rw
environment:
- SCRIPT_LOCATION=/scripts
- USERDATA_LOCATION=/userdata
- OUTPUT_LOCATION=/output

http-gateway:
Expand All @@ -78,6 +84,7 @@ services:
image: ghcr.io/developmentseed/titiler:latest
volumes:
- ./output:/output:ro
- ./userdata:/userdata:ro
environment:
- PORT=8000
- WORKERS_PER_CORE=1
Expand Down
Loading

0 comments on commit 25921cd

Please sign in to comment.