Skip to content

Commit

Permalink
Merge branch 'dev' into issues
Browse files Browse the repository at this point in the history
  • Loading branch information
njakuschona authored Apr 23, 2021
2 parents 3d44c6a + a635fc9 commit 40239bf
Show file tree
Hide file tree
Showing 35 changed files with 1,722 additions and 546 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Release

# Controls when the action will run.
on:

#every push which starts with a v
push:
tags:
- 'v*'




# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:



# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
release:
# Set the type of machine to run on
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install node
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Install dependencies
working-directory: ./ui
run: sudo npm install

- name: Create React Build
working-directory: ./ui
run: sudo npm run build

- name: Zip Buiĺd folder
uses: papeloto/action-zip@v1
with:
files: ui/build
dest: build.zip

- name: Save build s Artifact for dest porposes
uses: actions/upload-artifact@v1
with:
name: build
path: ${{ github.workspace }}/build.zip

- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
with:
path: ui/

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ steps.package-version.outputs.current-version}}"
title: "Release ${{ steps.package-version.outputs.current-version}}"
prerelease: false
files: |
${{ github.workspace }}/build.zip
31 changes: 27 additions & 4 deletions .github/workflows/main.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Install node
uses: actions/setup-node@v1
Expand All @@ -41,27 +41,50 @@ jobs:
- name: Start containers
run: docker-compose -f "ui/docker-compose.yml" up -d --build

- name: Sleep for 3 minutes
- name: Sleep for 1 minute
uses: jakejarvis/wait-action@master
with:
time: '3m'
time: '1m'

- name: Restart containers for guestlister
run: docker-compose -f "ui/docker-compose.yml" stop

- name: Restart containers for guestlister
run: docker-compose -f "ui/docker-compose.yml" up -d --build

- name: Sleep for 5 minute
uses: jakejarvis/wait-action@master
with:
time: '5m'


- name: Check running containers
run: docker ps

- name: Check logs of webserver
run: docker logs ui_webserver_1

- name: Check logs of guestlister
run: docker logs ui_guestlister_1

- name: Run tests
working-directory: ./ui
run: npm run test

- name: Check logs of loader
if: always()
run: docker logs ui_loader_1

- name: Save pictures
if: always()
uses: actions/upload-artifact@v2
with:
name: screenshots
path: ui/screenshots/
path: |
ui/screenshots/
ui/src/test/dummy_workspace.zip
ui/src/test/bindings_workspace.zip
- name: Stop containers
if: always()
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# o2r-UI
![Test](https://github.com/o2r-project/o2r-UI/actions/workflows/main.yml/badge.svg)


This project is a re-implementation of the [o2r-platform](https://github.com/o2r-project/o2r-platform) using React.

Expand Down Expand Up @@ -100,3 +102,21 @@ The images are built on Docker Hub:

- [o2rproject/ui](https://hub.docker.com/r/o2rproject/ui)
- [o2rproject/o2r-bindings](https://hub.docker.com/r/o2rproject/o2r-bindings)


## Test

Tests run as GitHub actions and you can inspect them over here:

![Test](https://github.com/o2r-project/o2r-UI/actions/workflows/main.yml/badge.svg)


To run the test by yourself, complete the following steps:

- Run the platform
- ```cd ui/```
- ```docker-compose up```
- Install all packages local
- ```npm install```
- Run all the test
- ```npm test```
13 changes: 0 additions & 13 deletions ui/dev/nginx-dev-local-microservices.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,11 @@ http {
proxy_set_header Host $host;
}

# muncher handles most API requests
location /api {
proxy_pass http://172.17.0.1:8080;
proxy_redirect off;
proxy_set_header Host $host;
}

# split endpoint between loader for POSTs and muncher for all other operations
location /api/v1/compendium {
proxy_pass http://172.17.0.1:8088;
proxy_redirect off;
proxy_set_header Host $host;
proxy_read_timeout 30m;

# For requests that *are not* a POST, pass to muncher
limit_except POST {
proxy_pass http://172.17.0.1:8080;
}
}

location ~* \.io {
Expand Down
23 changes: 1 addition & 22 deletions ui/dev/nginx-share.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
proxy_pass http://muncher:8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_read_timeout 30m;
}

location ~* ^/api/v1/compendium/[^/]+/binding {
Expand All @@ -15,20 +16,6 @@
proxy_set_header Host $host;
}

location /api/v1/compendium {
include nginx-cors.conf;

proxy_pass http://loader:8088;
proxy_redirect off;
proxy_set_header Host $host;
proxy_read_timeout 30m;

# For requests that *are not* a POST, pass to muncher
limit_except POST {
proxy_pass http://muncher:8080;
}
}

location ~* \.io {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
Expand Down Expand Up @@ -76,14 +63,6 @@
proxy_pass http://shipper:8087;
}

location /api/v1/inspection {
include nginx-cors.conf;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://inspecter:8091;
}

location /api/v1/bindings {
include nginx-cors.conf;

Expand Down
28 changes: 2 additions & 26 deletions ui/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ services:
# - elasticsearch

muncher:
image: o2rproject/o2r-muncher:0.27.0
image: o2rproject/o2r-muncher:0.30.0
depends_on:
- mongodb
- configmongodb
Expand All @@ -102,6 +102,7 @@ services:
- DEBUG=*,-mquery,-express:*,-express-session,-body-parser:*

- "MUNCHER_META_TOOL_CONTAINER=o2rproject/o2r-meta:1447d43"
#- "MUNCHER_META_TOOL_CONTAINER=meta:dev"
#- MUNCHER_META_TOOL_CONTAINER_RM=false
- MUNCHER_SAVE_IMAGE_TARBALL=false # saves space and time during dev
- MUNCHER_CONTAINERIT_IMAGE=o2rproject/containerit:geospatial-0.6.0.9000
Expand All @@ -110,22 +111,6 @@ services:
#- "MUNCHER_META_TOOL_CONTAINER=meta:dev"
#- MUNCHER_ALLOW_INVALID_METADATA=true

loader:
image: o2rproject/o2r-loader:0.12.0
depends_on:
- mongodb
- configmongodb
volumes:
- o2rstorage:/tmp/o2r
- /var/run/docker.sock:/var/run/docker.sock
environment:
- "LOADER_MONGODB=mongodb://mongodb:27017/"
- LOADER_PORT=8088
- DEBUG=*,-mquery,-express:*,-express-session,-body-parser:*
- LOADER_VOLUME=ui_o2rstorage
- "LOADER_META_TOOL_CONTAINER=o2rproject/o2r-meta:1447d43"
#- "LOADER_META_TOOL_CONTAINER=meta:dev"

informer:
image: o2rproject/o2r-informer:0.5.0
depends_on:
Expand Down Expand Up @@ -186,14 +171,6 @@ services:
SHIPPER_BASE_PATH: "/tmp/o2r"
PYTHONUNBUFFERED: "0"

inspecter:
image: o2rproject/o2r-inspecter:0.0.1
volumes:
- o2rstorage:/tmp/o2r
environment:
- INSPECTER_PORT=8091
- DEBUGME=inspecter

bindings:
#image: o2rproject/o2r-bindings:latest
build: ./bindings
Expand Down Expand Up @@ -245,7 +222,6 @@ services:
#- finder
- muncher
- informer
- loader
- shipper
- bindings
- ui
Expand Down
30 changes: 3 additions & 27 deletions ui/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ services:
- "1234:1234"

muncher:
image: o2rproject/o2r-muncher:0.27.0
image: o2rproject/o2r-muncher:0.30.0
depends_on:
- mongodb
- configmongodb
Expand All @@ -61,30 +61,15 @@ services:
- DEBUG=*,-mquery,-express:*,-express-session,-body-parser:*

- "MUNCHER_META_TOOL_CONTAINER=o2rproject/o2r-meta:1447d43"
#- "MUNCHER_META_TOOL_CONTAINER=meta:dev"
#- MUNCHER_META_TOOL_CONTAINER_RM=false
- MUNCHER_SAVE_IMAGE_TARBALL=false # saves space and time during dev
- MUNCHER_CONTAINERIT_IMAGE=o2rproject/containerit:geospatial-0.6.0.9000
- MUNCHER_CONTAINERIT_FILTER_BASE_IMAGE_PKGS=true
- "MUNCHER_CONTAINERIT_BASE_IMAGE=rocker/geospatial:3.6.2"
#- "MUNCHER_META_TOOL_CONTAINER=meta:dev"
#- MUNCHER_ALLOW_INVALID_METADATA=true

loader:
image: o2rproject/o2r-loader:0.12.0
depends_on:
- mongodb
- configmongodb
volumes:
- o2rstorage:/tmp/o2r
- /var/run/docker.sock:/var/run/docker.sock
environment:
- "LOADER_MONGODB=mongodb://mongodb:27017/"
- LOADER_PORT=8088
- DEBUG=*,-mquery,-express:*,-express-session,-body-parser:*
- LOADER_VOLUME=ui_o2rstorage
- "LOADER_META_TOOL_CONTAINER=o2rproject/o2r-meta:1447d43"
#- "LOADER_META_TOOL_CONTAINER=meta:dev"


informer:
image: o2rproject/o2r-informer:0.5.0
depends_on:
Expand Down Expand Up @@ -128,14 +113,6 @@ services:
SHIPPER_BASE_PATH: "/tmp/o2r"
PYTHONUNBUFFERED: "0"

inspecter:
image: o2rproject/o2r-inspecter:0.0.1
volumes:
- o2rstorage:/tmp/o2r
environment:
- INSPECTER_PORT=8091
- DEBUGME=inspecter

bindings:
image: o2rproject/o2r-bindings:latest
#build: ./bindings
Expand Down Expand Up @@ -167,7 +144,6 @@ services:
- bouncer
- muncher
- informer
- loader
- shipper
- bindings
ports:
Expand Down
Loading

0 comments on commit 40239bf

Please sign in to comment.