Skip to content

Commit

Permalink
Merge pull request #752 from VirtualFlyBrain/development
Browse files Browse the repository at this point in the history
latest from Development
  • Loading branch information
Robbie1977 authored Nov 5, 2020
2 parents 5bdc23e + ac46144 commit 6fa16e4
Show file tree
Hide file tree
Showing 23 changed files with 1,187 additions and 314 deletions.
188 changes: 188 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push only. ToDo: handle pull requests for testing only
on:
push:
branches: '*'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Deploy the local and remote versions of geppetto-vfb
deploy-test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# total job timeout:
timeout-minutes: 60

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Decide based on branch which servers to use
- name: Pass branch
id: branch
run: echo "::set-output name=value::${GITHUB_REF##*/}";
- name: Setup local servers
id: local-servers
shell: bash
run: if [ "${GITHUB_REF##*/}" == master ] ; then
echo "::debug::Set to master setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb:7474";
echo "::set-output name=VFB_OWL_SERVER::http://owl:8080/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://ocpu:80/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::release";
elif [ "${GITHUB_REF##*/}" == debug ] || [ "${GITHUB_REF##*/}" == pipeline2 ] || [ "${GITHUB_REF##*/}" == vfb_geppetto_application ] || [ "${GITHUB_REF##*/}" == development ] ; then
echo "::debug::Set to dev setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb:7474";
echo "::set-output name=VFB_OWL_SERVER::http://owl:8080/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://ocpu:80/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb-dev.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr-dev.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::development";
elif [ "${GITHUB_REF##*/}" == alpha ] ; then
echo "::debug::Set to alpha setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb:7474";
echo "::set-output name=VFB_OWL_SERVER::http://owl:8080/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://ocpu:80/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb-alpha.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr-alpha.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::staging";
else
echo "::debug::Set to default setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb:7474";
echo "::set-output name=VFB_OWL_SERVER::http://owl:8080/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://ocpu:80/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::release";
fi
- name: Setup remote servers
id: remote-servers
shell: bash
run: if [ "${GITHUB_REF##*/}" == master ] ; then
echo "::debug::Set to master setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb.virtualflybrain.org";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb.virtualflybrain.org";
echo "::set-output name=VFB_OWL_SERVER::http://owl.virtualflybrain.org/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://r.virtualflybrain.org/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=SOLR_SERVER::https://solr.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::release";
elif [ "${GITHUB_REF##*/}" == debug ] || [ "${GITHUB_REF##*/}" == pipeline2 ] || [ "${GITHUB_REF##*/}" == vfb_geppetto_application ] || [ "${GITHUB_REF##*/}" == development ] ; then
echo "::debug::Set to dev setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb-dev.virtualflybrain.org";
echo "::set-output name=VFB_OWL_SERVER::http://owl-dev.virtualflybrain.org/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://r.virtualflybrain.org/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb-dev.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr-dev.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::release";
elif [ "${GITHUB_REF##*/}" == alpha ] ; then
echo "::debug::Set to alpha setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb-alpha.virtualflybrain.org";
echo "::set-output name=VFB_OWL_SERVER::http://owl-alpha.virtualflybrain.org/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://r.virtualflybrain.org/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb-alpha.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr-alpha.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::release";
else
echo "::debug::Set to default setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb.virtualflybrain.org";
echo "::set-output name=VFB_OWL_SERVER::http://owl.virtualflybrain.org/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://r.virtualflybrain.org/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::release";
fi

# Output the chosen servers
- name: Used remote servers
run: |
echo PDB:${{ steps.remote-servers.outputs.VFB_PDB_SERVER }}
echo OWL:${{ steps.remote-servers.outputs.VFB_OWL_SERVER }}
echo SOLR:${{ steps.remote-servers.outputs.SOLR_SERVER }}
echo TREE_PDB:${{ steps.remote-servers.outputs.VFB_TREE_PDB_SERVER }}
echo R:${{ steps.remote-servers.outputs.VFB_R_SERVER }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push local wss
id: docker_build_local
timeout-minutes: 15
uses: docker/build-push-action@v2
with:
push: true
tags: "virtualflybrain/geppetto-vfb:${{ steps.branch.outputs.value }}-local.wss"
build-args: |
VFB_TREE_PDB_SERVER_ARG=${{ steps.local-servers.outputs.VFB_TREE_PDB_SERVER }}
SOLR_SERVER_ARG=${{ steps.local-servers.outputs.SOLR_SERVER }}
VFB_R_SERVER_ARG=${{ steps.local-servers.outputs.VFB_R_SERVER }}
VFB_OWL_SERVER_ARG=${{ steps.local-servers.outputs.VFB_OWL_SERVER }}
VFB_PDB_SERVER_ARG=${{ steps.local-servers.outputs.VFB_PDB_SERVER }}
build_type=${{ steps.local-servers.outputs.BUILD_TYPE }}
targetBranch=${{ steps.branch.outputs.value }}
originBranch=${{ steps.branch.outputs.value }}
defaultBranch=development
finalBuild=true
- name: Build and push remote
id: docker_build_remote
timeout-minutes: 15
uses: docker/build-push-action@v2
with:
push: true
tags: "virtualflybrain/geppetto-vfb:${{ steps.branch.outputs.value }}-remote"
build-args: |
VFB_TREE_PDB_SERVER_ARG=${{ steps.remote-servers.outputs.VFB_TREE_PDB_SERVER }}
SOLR_SERVER_ARG=${{ steps.remote-servers.outputs.SOLR_SERVER }}
VFB_R_SERVER_ARG=${{ steps.remote-servers.outputs.VFB_R_SERVER }}
VFB_OWL_SERVER_ARG=${{ steps.remote-servers.outputs.VFB_OWL_SERVER }}
VFB_PDB_SERVER_ARG=${{ steps.remote-servers.outputs.VFB_PDB_SERVER }}
build_type=${{ steps.remote-servers.outputs.BUILD_TYPE }}
targetBranch=${{ steps.branch.outputs.value }}
originBranch=${{ steps.branch.outputs.value }}
defaultBranch=development
finalBuild=false
- name: Image digest
run: |
echo "local:${{ steps.docker_build_local.outputs.digest }}"
echo "remote:${{ steps.docker_build_remote.outputs.digest }}"
- name: Install Puppeteer
run: npm install jest@24.8.0 jest-image-snapshot@4.1.0 puppeteer@1.17.0 jest-puppeteer@4.3.0 @babel/preset-env@7.4.5 url-join@4.0.0 @babel/core@7.4.5
- name: Start VFB server
run: docker run -t -dit --name=testServer -p 8080:8080 "virtualflybrain/geppetto-vfb:${{ steps.branch.outputs.value }}-remote";
- name: Wait for VFB server to spin up
run: |
export LANDING_PAGE="http://localhost:8080/org.geppetto.frontend/geppetto"
Test () { export http_status=$(curl -s -i $LANDING_PAGE | grep HTTP/1.1 | awk {'print $2'}); echo "Returned status \"$http_status\""; if [ "$http_status" != "200" ]; then echo "Waiting for docker to finish building..."; iterations=$((iterations+1)); if [ "$iterations" != "100" ]; then sleep 1; Test; fi; else echo "$(date) - connected successfully"; fi; }
Test;
- name: Test batch 1
run: npm test -- --verbose --colors --forceExit --testPathPattern='geppetto-vfb/tests/jest/vfb/batch1/.*js'
- name: Test batch 2
run: npm test -- --verbose --colors --forceExit --testPathPattern='geppetto-vfb/tests/jest/vfb/batch2/.*js'
- name: Test batch 3
run: npm test -- --verbose --colors --forceExit --testPathPattern='geppetto-vfb/tests/jest/vfb/batch3/.*js'
- name: Test under review
continue-on-error: true
run: |
if [ "${GITHUB_REF##*/}" == debug ] || [ "${GITHUB_REF##*/}" == pipeline2 ] || [ "${GITHUB_REF##*/}" == vfb_geppetto_application ] || [ "${GITHUB_REF##*/}" == development ] || [[ "${GITHUB_REF##*/}" =~ ^(fix|feature).* ]] ; then
npm test -- --verbose --colors --forceExit --testPathPattern='geppetto-vfb/tests/jest/vfb/review/.*js';
fi
- name: Stop VFB server
run: docker stop testServer
16 changes: 8 additions & 8 deletions .travis.yml → NoLongerUsed.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- if [ "$BUILD_TYPE" == "development" ]; then export TAG=$TAG-development; fi;
- export TAG="$TAG-TEST"
install:
- npm install jest@24.8.0 puppeteer@1.17.0 jest-puppeteer@4.3.0 @babel/preset-env@7.4.5 url-join@4.0.0 @babel/core@7.4.5
- npm install jest@24.8.0 jest-image-snapshot@4.1.0 puppeteer@1.17.0 jest-puppeteer@4.3.0 @babel/preset-env@7.4.5 url-join@4.0.0 @babel/core@7.4.5
before_script:
- echo -e "travis_fold:start:Docker_Run" || true
- docker login -u $DOCKER_USER -p $DOCKER_PASS;
Expand All @@ -104,7 +104,7 @@ jobs:
done;
- echo -e "travis_fold:end:Startup_Server3" || true
script:
- travis_wait 41 npm test -- --verbose --colors --forceExit --testPathPattern='tests/jest/vfb/batch1/.*js'
- travis_wait 41 npm test -- --updateSnapshot --verbose --colors --forceExit --testPathPattern='tests/jest/vfb/batch1/.*js'
after_failure:
- docker ps -a
- docker logs $CONTAINER_NAME
Expand All @@ -122,7 +122,7 @@ jobs:
- if [ "$BUILD_TYPE" == "development" ]; then export TAG=$TAG-development; fi;
- export TAG="$TAG-TEST"
install:
- npm install jest@24.8.0 puppeteer@1.17.0 jest-puppeteer@4.3.0 @babel/preset-env@7.4.5 url-join@4.0.0 @babel/core@7.4.5
- npm install jest@24.8.0 jest-image-snapshot@4.1.0 puppeteer@1.17.0 jest-puppeteer@4.3.0 @babel/preset-env@7.4.5 url-join@4.0.0 @babel/core@7.4.5
before_script:
- echo -e "travis_fold:start:Docker_Run" || true
- docker login -u $DOCKER_USER -p $DOCKER_PASS;
Expand All @@ -144,7 +144,7 @@ jobs:
done;
- echo -e "travis_fold:end:Startup_Server3" || true
script:
- travis_wait 41 npm test -- --verbose --colors --forceExit --testPathPattern='tests/jest/vfb/batch2/.*js'
- travis_wait 41 npm test -- --updateSnapshot --verbose --colors --forceExit --testPathPattern='tests/jest/vfb/batch2/.*js'
after_failure:
- docker ps -a
- docker logs $CONTAINER_NAME
Expand All @@ -162,7 +162,7 @@ jobs:
- if [ "$BUILD_TYPE" == "development" ]; then export TAG=$TAG-development; fi;
- export TAG="$TAG-TEST"
install:
- npm install jest@24.8.0 puppeteer@1.17.0 jest-puppeteer@4.3.0 @babel/preset-env@7.4.5 url-join@4.0.0 @babel/core@7.4.5
- npm install jest@24.8.0 jest-image-snapshot@4.1.0 puppeteer@1.17.0 jest-puppeteer@4.3.0 @babel/preset-env@7.4.5 url-join@4.0.0 @babel/core@7.4.5
before_script:
- echo -e "travis_fold:start:Docker_Run" || true
- docker login -u $DOCKER_USER -p $DOCKER_PASS;
Expand All @@ -184,7 +184,7 @@ jobs:
done;
- echo -e "travis_fold:end:Startup_Server3" || true
script:
- travis_wait 41 npm test -- --verbose --colors --forceExit --testPathPattern='tests/jest/vfb/batch3/.*js'
- travis_wait 41 npm test -- --updateSnapshot --verbose --colors --forceExit --testPathPattern='tests/jest/vfb/batch3/.*js'
after_failure:
- docker ps -a
- sudo docker cp $CONTAINER_NAME:/home/developer/virgo/serviceability/logs/log.log /etc
Expand Down Expand Up @@ -272,7 +272,7 @@ jobs:
- if [ "$BUILD_TYPE" == "development" ]; then export TAG=$TAG-development; fi;
- export TAG="$TAG-TEST"
install:
- npm install jest@24.8.0 puppeteer@1.17.0 jest-puppeteer@4.3.0 @babel/preset-env@7.4.5 url-join@4.0.0 @babel/core@7.4.5
- npm install jest@24.8.0 jest-image-snapshot@4.1.0 puppeteer@1.17.0 jest-puppeteer@4.3.0 @babel/preset-env@7.4.5 url-join@4.0.0 @babel/core@7.4.5
before_script:
- echo -e "travis_fold:start:Docker_Run" || true
- docker login -u $DOCKER_USER -p $DOCKER_PASS;
Expand All @@ -294,7 +294,7 @@ jobs:
done;
- echo -e "travis_fold:end:Startup_Server3" || true
script:
- travis_wait 41 npm test -- --verbose --colors --forceExit --testPathPattern='tests/jest/vfb/review/.*js'
- travis_wait 41 npm test -- --updateSnapshot --verbose --colors --forceExit --testPathPattern='tests/jest/vfb/review/.*js'
after_failure:
- docker ps -a
- docker logs $CONTAINER_NAME
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/VirtualFlyBrain/geppetto-vfb.svg?branch=master)](https://travis-ci.org/VirtualFlyBrain/geppetto-vfb)[![Docker Hub](https://www.shippable.com/assets/images/logos/docker-hub.jpg)](https://hub.docker.com/r/virtualflybrain/geppetto-vfb/)
[![Build Status](https://github.com/VirtualFlyBrain/geppetto-vfb/workflows/CI/badge.svg)](https://github.com/Robbie1977/geppetto-vfb/actions?query=workflow%3ACI)[![Docker Hub](https://www.shippable.com/assets/images/logos/docker-hub.jpg)](https://hub.docker.com/r/virtualflybrain/geppetto-vfb/)

# geppetto-vfb
Virtual Fly Brain project customised Geppetto build
Expand Down
4 changes: 2 additions & 2 deletions components/VFBMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -1062,12 +1062,12 @@ class VFBMain extends React.Component {
/**
* If redux action was to set term info visible, we handle it here, other wise 'shouldComponentUpdate' will prevent update
*/
if ( nextProps.generals.termInfoVisible && nextProps.generals.type === VFB_LOAD_TERM_INFO ) {
if ( nextProps.generals.ui.termInfo.termInfoVisible && nextProps.generals.type === VFB_LOAD_TERM_INFO ) {
this.setActiveTab("termInfo");
this.termInfoReference.setTermInfo(this.instanceOnFocus);
}

if ( nextProps.generals.listViewerInfoVisible && nextProps.generals.type === SHOW_LIST_VIEWER ) {
if ( nextProps.generals.ui.layers.listViewerInfoVisible && nextProps.generals.type === SHOW_LIST_VIEWER ) {
if (this.listViewerReference === undefined || this.listViewerReference === null) {
this.setState({
UIUpdated: true,
Expand Down
6 changes: 3 additions & 3 deletions components/configuration/VFBGraph/graphConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ var locationCypherQuery = instance => ({
var whatCypherQuery = instance => ({
"statements": [
{
"statement": "MATCH p=(n:Entity {short_form:'" + instance + "'})-[:INSTANCEOF|:SUBCLASSOF*..]->(x) "
+ "WHERE (('Cell' IN labels(x)) OR ('synaptic neuropil' IN labels(x))) "
"statement": "MATCH (n:Entity {short_form:'" + instance + "'}) OPTIONAL MATCH p=(n)-[:INSTANCEOF|:SUBCLASSOF*..]->(x) "
+ "WHERE (('Anatomy' IN labels(x)) AND ('Class' IN labels(n))) OR (('Cell' IN labels(x)) OR ('synaptic neuropil' IN labels(x))) "
+ " OR (('Ganglion' IN labels(x)) OR ('Neuron_projection_bundle' IN labels(x))) "
+ "RETURN p, n.short_form as root",
+ "RETURN n,p, n.short_form as root",
"resultDataContents": ["graph"]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ class VFBCircuitBrowser extends Component {
VFBCircuitBrowser.propTypes = { classes: PropTypes.object.isRequired };

function mapStateToProps (state) {
return { circuitQuerySelected : state.generals.circuitQuerySelected }
return { circuitQuerySelected : state.generals.ui.circuitBrowser.circuitQuerySelected }
}

export default connect(mapStateToProps, null, null, { forwardRef : true } )(withStyles(styles)(VFBCircuitBrowser));
2 changes: 1 addition & 1 deletion components/interface/VFBGraph/VFBGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ class VFBGraph extends Component {

function mapStateToProps (state) {
return {
graphQueryIndex : state.generals.graphQueryIndex,
graphQueryIndex : state.generals.ui.graph.graphQueryIndex,
instanceOnFocus : state.generals.instanceOnFocus
}
}
Expand Down
6 changes: 4 additions & 2 deletions components/interface/VFBListViewer/ListViewerControlsMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ class ListViewerControlsMenu extends Component {
var self = this;
instance.getType().resolve(function () {
self.props.instance.setColor(color);
GEPPETTO.trigger('experiment:visibility_changed', instance);
GEPPETTO.ControlPanel.refresh();
if ( instance.getInstancePath !== undefined ) {
GEPPETTO.trigger('experiment:visibility_changed', instance);
GEPPETTO.ControlPanel.refresh();
}
});
} else {
if (GEPPETTO.SceneController.isInstancePresent(instance)) {
Expand Down
2 changes: 1 addition & 1 deletion components/interface/VFBListViewer/VFBListViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ class VFBListViewer extends Component {

function mapStateToProps (state) {
return {
instanceDeleted : state.generals.ui.canvas.instanceDeleted,
instanceOnFocus : state.generals.instanceOnFocus,
instanceDeleted : state.generals.instanceDeleted,
idsMap : state.generals.idsMap,
idsList : state.generals.idsList
}
Expand Down
Loading

0 comments on commit 6fa16e4

Please sign in to comment.