Skip to content

Commit

Permalink
Merge pull request #941 from OpenSourceBrain/feature/biomodels
Browse files Browse the repository at this point in the history
Feature/biomodels
  • Loading branch information
filippomc authored Jan 23, 2025
2 parents 8f30081 + 32007cb commit 7b050d7
Show file tree
Hide file tree
Showing 42 changed files with 2,183 additions and 280 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/deploy-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Deploy OSBv2 to Dev
on:
push:
branches: [ develop, release/* ]

jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v2
name: Post main clone
with:
name: MetaCell/cloud-harness
ref: ${{ vars.CLOUDHARNESS_BRANCH || 'master' }}

- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Prepare helm chart
run: |
bash cloud-harness/install.sh
harness-deployment cloud-harness . -d ${{vars.DOMAIN}} -r ${{vars.REGISTRY}} -rs ${{secrets.REGISTRY_SECRET}}
-n ${{vars.NAMESPACE}} --write-env -e dev -i osb-portal
- uses: actions/upload-artifact@v4
with:
name: env_vars_to_export
path: deployment/.env
build-base-images:
runs-on: ubuntu-latest
steps:

- name: Build the Docker image
run: |
cd applications/nwb-explorer
docker build -t mynwbexplorer -f Dockerfile --no-cache .
- name: Deploy to Dev
uses: MetaCell/deploy-osbv2@v1
with:
environment: dev
service: nwbexplorer
port: 80
dependencies: jupyterhub
git:

3 changes: 3 additions & 0 deletions applications/jupyterlab/deploy/values-quick.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
harness:
deployment:
image: gcr.io/metacellllc/osb/netpyne:0.7.6.2
3 changes: 3 additions & 0 deletions applications/netpyne/deploy/values-quick.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
harness:
deployment:
image: gcr.io/metacellllc/osb/netpyne:0.7.6.2
1 change: 0 additions & 1 deletion applications/netpyne/deploy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ harness:
name: proxy-public
deployment:
auto: false
image: netpyne:latest
jupyterhub:
args: ["--NotebookApp.default_url=/geppetto", "--library=netpyne_ui", "--NotebookApp.notebook_dir=/opt/workspace", "--NotebookApp.disable_check_xsrf=True"]
applicationHook: "osb_jupyter.change_pod_manifest"
Expand Down
5 changes: 5 additions & 0 deletions applications/nwb-explorer/deploy/values-quick.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
harness:
deployment:
image: gcr.io/metacellllc/osb/nwb-explorer:0.7.6.2
dependencies: {}

2 changes: 1 addition & 1 deletion applications/nwb-explorer/deploy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ harness:
dependencies:
git:
- url: https://github.com/MetaCell/nwb-explorer.git
branch_tag: development
branch_tag: master
jupyterhub:
args: ["--debug", "--NotebookApp.default_url=/geppetto", "--library=nwb_explorer", "--NotebookApp.notebook_dir=/opt/workspace"]
applicationHook: "osb_jupyter.change_pod_manifest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apis/K8sApi.ts
apis/RestApi.ts
apis/index.ts
index.ts
models/BiomodelsRepositoryResource.ts
models/DandiRepositoryResource.ts
models/DownloadResource.ts
models/FigshareRepositoryResource.ts
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
* OSB Workspaces manager API
* Opensource Brain Platform - Reference Workspaces manager API
*
* The version of the OpenAPI document: 0.2.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { exists, mapValues } from '../runtime';
import {
RepositoryResourceBase,
RepositoryResourceBaseFromJSON,
RepositoryResourceBaseFromJSONTyped,
RepositoryResourceBaseToJSON,
} from './';

/**
* figshare repository resource
* @export
* @interface BiomodelsRepositoryResource
*/
export interface BiomodelsRepositoryResource {
/**
* file name
* @type {string}
* @memberof BiomodelsRepositoryResource
*/
name?: string;
/**
* Download URL of the Resource
* @type {string}
* @memberof BiomodelsRepositoryResource
*/
path?: string;
/**
* OSB Repository id
* @type {number}
* @memberof BiomodelsRepositoryResource
*/
osbrepositoryId?: number;
/**
* File size in bytes of the RepositoryResource
* @type {number}
* @memberof BiomodelsRepositoryResource
*/
size?: number;
/**
* Date/time the ReposityResource is last modified
* @type {Date}
* @memberof BiomodelsRepositoryResource
*/
timestampModified?: Date;
}

export function BiomodelsRepositoryResourceFromJSON(json: any): BiomodelsRepositoryResource {
return BiomodelsRepositoryResourceFromJSONTyped(json, false);
}

export function BiomodelsRepositoryResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): BiomodelsRepositoryResource {
if ((json === undefined) || (json === null)) {
return json;
}
return {

'name': !exists(json, 'name') ? undefined : json['name'],
'path': !exists(json, 'path') ? undefined : json['path'],
'osbrepositoryId': !exists(json, 'osbrepository_id') ? undefined : json['osbrepository_id'],
'size': !exists(json, 'size') ? undefined : json['size'],
'timestampModified': !exists(json, 'timestamp_modified') ? undefined : (new Date(json['timestamp_modified'])),
};
}

export function BiomodelsRepositoryResourceToJSON(value?: BiomodelsRepositoryResource | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {

'name': value.name,
'path': value.path,
'osbrepository_id': value.osbrepositoryId,
'size': value.size,
'timestamp_modified': value.timestampModified === undefined ? undefined : (value.timestampModified.toISOString()),
};
}


Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
export enum RepositoryType {
Dandi = 'dandi',
Figshare = 'figshare',
Github = 'github'
Github = 'github',
Biomodels = 'biomodels'
}

export function RepositoryTypeFromJSON(json: any): RepositoryType {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './BiomodelsRepositoryResource';
export * from './DandiRepositoryResource';
export * from './DownloadResource';
export * from './FigshareRepositoryResource';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import { RepositoryType } from "../../apiclient/workspaces";
export default {
[RepositoryType.Dandi]: "DANDI Archive",
[RepositoryType.Github]: "GitHub",
[RepositoryType.Biomodels]: "Biomodels",
} as any;
7 changes: 7 additions & 0 deletions applications/osb-portal/src/pages/RepositoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,13 @@ export const RepositoryPage = (props: any) => {
case "figshare":
window.open(`${repository.uri}`, "_blank");
break;
// Biomodels: repo.version
case "biomodels":
window.open(
`${repository.uri + "." + repository.defaultContext}`,
"_blank"
);
break;
default:
window.open(`#`, "_blank");
}
Expand Down
10 changes: 8 additions & 2 deletions applications/workspaces/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,7 @@ components:
- dandi
- figshare
- github
- biomodels
type: string
RepositoryContentType:
description: |
Expand Down Expand Up @@ -1412,7 +1413,6 @@ components:
-
$ref: '#/components/schemas/WorkspaceResourceBase'
-
x-tablename: Workspaceresource
properties:
origin:
description: Origin data JSON formatted of the WorkspaceResource
Expand All @@ -1425,6 +1425,7 @@ components:
description: WorkspaceResource path where the resource will stored in the pvc.
type: string
example: repo/sample.nwb
x-tablename: Workspaceresource
WorkspaceResource:
description: Workspace Resource item of a Workspace
allOf:
Expand Down Expand Up @@ -1505,6 +1506,11 @@ components:
$ref: '#/components/schemas/Tag'
-
x-secondary: osbrepository_tag
BiomodelsRepositoryResource:
description: figshare repository resource
allOf:
-
$ref: '#/components/schemas/RepositoryResourceBase'
securitySchemes:
bearerAuth:
scheme: bearer
Expand All @@ -1523,4 +1529,4 @@ tags:
description: Consumer
-
name: Client
description: Client
description: Client
14 changes: 6 additions & 8 deletions applications/workspaces/server/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ workspaces/controllers/k8s_controller.py
workspaces/controllers/rest_controller.py
workspaces/controllers/security_controller_.py
workspaces/models/base_model_.py
workspaces/models/biomodels_repository_resource.py
workspaces/models/dandi_repository_resource.py
workspaces/models/download_resource.py
workspaces/models/figshare_repository_resource.py
workspaces/models/git_repository_resource.py
workspaces/models/git_repository_resource_all_of.py
workspaces/models/inline_object.py
workspaces/models/inline_response200.py
workspaces/models/inline_response2001.py
workspaces/models/inline_response2002.py
workspaces/models/inline_response2003.py
workspaces/models/osb_repository.py
workspaces/models/osb_repository_all_of.py
workspaces/models/osb_repository_base.py
workspaces/models/osb_repository_base_tags_inner.py
workspaces/models/osb_repository_entity.py
workspaces/models/osbrepository_get200_response.py
workspaces/models/pagination.py
workspaces/models/repository_content_type.py
workspaces/models/repository_info.py
Expand All @@ -29,27 +33,21 @@ workspaces/models/resource_origin.py
workspaces/models/resource_status.py
workspaces/models/resource_type.py
workspaces/models/tag.py
workspaces/models/tag_get200_response.py
workspaces/models/user.py
workspaces/models/valid.py
workspaces/models/volume_storage.py
workspaces/models/volumestorage_get200_response.py
workspaces/models/workspace.py
workspaces/models/workspace_all_of.py
workspaces/models/workspace_base.py
workspaces/models/workspace_base_gallery_inner.py
workspaces/models/workspace_base_tags_inner.py
workspaces/models/workspace_collaborator.py
workspaces/models/workspace_entity.py
workspaces/models/workspace_entity_all_of.py
workspaces/models/workspace_get200_response.py
workspaces/models/workspace_image.py
workspaces/models/workspace_resource.py
workspaces/models/workspace_resource_all_of.py
workspaces/models/workspace_resource_base.py
workspaces/models/workspace_resource_entity.py
workspaces/models/workspace_resource_entity_all_of.py
workspaces/models/workspaces_controllers_workspace_controller_import_resources_request.py
workspaces/openapi/openapi.yaml
workspaces/typing_utils.py
workspaces/util.py
2 changes: 1 addition & 1 deletion applications/workspaces/server/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.2.1
5.1.0
2 changes: 1 addition & 1 deletion applications/workspaces/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ is an example of building a OpenAPI-enabled Flask server.
This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask.

## Requirements
Python 3.9+
Python 3.5.2+

## Usage
To run the server, please execute the following from the root directory:
Expand Down
7 changes: 4 additions & 3 deletions applications/workspaces/server/git_push.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"

git_user_id=$1
git_repo_id=$2
Expand Down Expand Up @@ -38,14 +38,14 @@ git add .
git commit -m "$release_note"

# Sets the new remote
git_remote=$(git remote)
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined

if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
fi

fi
Expand All @@ -55,3 +55,4 @@ git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

2 changes: 1 addition & 1 deletion applications/workspaces/server/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"flask_cors",
"sentry-sdk",
"responses==0.22.0",
"jinja2<3.1.0"
"jinja2<3.2.0"
]

setup(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import connexion
import six
from typing import Dict
from typing import Tuple
from typing import Union

from workspaces import util

Expand All @@ -13,7 +10,7 @@ def live(): # noqa: E501
# noqa: E501
:rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]]
:rtype: str
"""
return 'do some magic!'

Expand All @@ -24,6 +21,6 @@ def ready(): # noqa: E501
# noqa: E501
:rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]]
:rtype: str
"""
return 'do some magic!'
Loading

0 comments on commit 7b050d7

Please sign in to comment.