Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schemas 2.0 #423

Open
wants to merge 56 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
d59bd90
Merge pull request #395 from pepkit/dev
sanghoonio Sep 25, 2024
3a85a7f
Merge pull request #398 from pepkit/dev
khoroshevskyi Oct 4, 2024
784c709
Merge pull request #403 from pepkit/dev
nleroy917 Dec 4, 2024
9e648a0
calidation stuff
nleroy917 Dec 4, 2024
4c700a2
go back to the fix
nleroy917 Dec 4, 2024
040fe92
remove bedms, for now
nleroy917 Dec 4, 2024
62997ed
bump version
nleroy917 Dec 4, 2024
1cd0071
Merge pull request #406 from pepkit/rm_bedms
nleroy917 Dec 4, 2024
57ca04b
Merge pull request #409 from pepkit/dev
khoroshevskyi Dec 5, 2024
30042bb
updated version
khoroshevskyi Dec 5, 2024
9aea8da
added info about organizations
khoroshevskyi Dec 5, 2024
52853cd
work on schemas2.0
khoroshevskyi Mar 6, 2025
d17d027
Merge branch 'dev' into schemas2.0
khoroshevskyi Mar 6, 2025
fd3bffa
Schema2.0 for pephub
khoroshevskyi Mar 15, 2025
895d571
add dev task def
nsheff Mar 18, 2025
112fadb
updated dockerfile build and push
khoroshevskyi Mar 18, 2025
af77e21
Merge remote-tracking branch 'origin/master'
khoroshevskyi Mar 18, 2025
d794cf3
Merge branch 'master' into schemas2.0
khoroshevskyi Mar 18, 2025
234a9f4
fixed pepdbagent branch
khoroshevskyi Mar 18, 2025
6edf8eb
Use dev postgres db
nsheff Mar 18, 2025
e601abd
added deployment of dev api
khoroshevskyi Mar 18, 2025
7f2b029
Merge branch 'master' into schemas2.0
khoroshevskyi Mar 18, 2025
f3d3bde
updated aws repo
khoroshevskyi Mar 18, 2025
14f423b
Updated Dockerfile for deployment
khoroshevskyi Mar 18, 2025
6113f28
Merge branch 'master' into schemas2.0
khoroshevskyi Mar 18, 2025
57f0345
Update dev.json
nsheff Mar 18, 2025
68b76a9
Merge pull request #421 from pepkit/nsheff-patch-1
nsheff Mar 18, 2025
5e19425
updated namespace info endpoint
khoroshevskyi Mar 18, 2025
d860f29
Update dev.json
nsheff Mar 19, 2025
973e778
Merge pull request #422 from pepkit/master
nsheff Mar 19, 2025
6796522
fixed return format for schemas
khoroshevskyi Mar 19, 2025
959f8fd
Merge remote-tracking branch 'origin/schemas2.0' into schemas2.0
khoroshevskyi Mar 19, 2025
b8eb1ec
schema 2.0 ui progress
sanghoonio Mar 19, 2025
3d24bb8
requirements typo
sanghoonio Mar 19, 2025
a4f34fe
Merge branch 'schemas2.0' of github.com:pepkit/pephub into schemas2.0
sanghoonio Mar 19, 2025
212ba7c
schema page redesign
sanghoonio Mar 20, 2025
34fa77b
Updated namespace schema endpoints
khoroshevskyi Mar 20, 2025
0cdc10e
Merge remote-tracking branch 'origin/schemas2.0' into schemas2.0
khoroshevskyi Mar 20, 2025
03fbefb
updated lint
khoroshevskyi Mar 20, 2025
55bc12e
updated lint
khoroshevskyi Mar 20, 2025
290a478
add schema edit and version modals
sanghoonio Mar 20, 2025
8e598c8
Merge branch 'schemas2.0' of github.com:pepkit/pephub into schemas2.0
sanghoonio Mar 20, 2025
605e47d
schemas 2.0 basic features working (add json or file, edit, create ve…
sanghoonio Mar 20, 2025
4191335
black
sanghoonio Mar 20, 2025
33755d6
few endpoint specification fixes
khoroshevskyi Mar 24, 2025
55b84ed
Merge remote-tracking branch 'origin/schemas2.0' into schemas2.0
khoroshevskyi Mar 24, 2025
63c3e21
frontend progress
sanghoonio Mar 24, 2025
56658fe
Merge branch 'schemas2.0' of github.com:pepkit/pephub into schemas2.0
sanghoonio Mar 24, 2025
7f91d72
changed upload schema endpoints to allow optional description, lifecy…
sanghoonio Mar 24, 2025
25cd988
Added download json format in schemas
khoroshevskyi Mar 25, 2025
10633ce
Merge remote-tracking branch 'origin/schemas2.0' into schemas2.0
khoroshevskyi Mar 25, 2025
2854e43
Fixed #417
khoroshevskyi Mar 25, 2025
012a978
schema ui checkpoint
sanghoonio Mar 25, 2025
71c54eb
error schema page
sanghoonio Mar 25, 2025
fb3cb86
Fixed Home page stats
khoroshevskyi Mar 25, 2025
cba33f1
schema ui fixes and namespace page loading
sanghoonio Mar 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: psf/black@stable
78 changes: 78 additions & 0 deletions .github/workflows/deploy-api-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# This workflow will build and push a new container image to Amazon ECR,
# and then will deploy a new task definition to Amazon ECS, when a release is created
#
# To use this workflow, you will need to complete the following set-up steps:
#
# 1. Create an ECR repository to store your images.
# For example: `aws ecr create-repository --repository-name my-ecr-repo --region us-east-2`.
# Replace the value of `ECR_REPOSITORY` in the workflow below with your repository's name.
# Replace the value of `aws-region` in the workflow below with your repository's region.
#
# 2. Create an ECS task definition, an ECS cluster, and an ECS service.
# For example, follow the Getting Started guide on the ECS console:
# https://us-east-2.console.aws.amazon.com/ecs/home?region=us-east-2#/firstRun
# Replace the values for `service` and `cluster` in the workflow below with your service and cluster names.
#
# 3. Store your ECS task definition as a JSON file in your repository.
# The format should follow the output of `aws ecs register-task-definition --generate-cli-skeleton`.
# Replace the value of `task-definition` in the workflow below with your JSON file's name.
# Replace the value of `container-name` in the workflow below with the name of the container
# in the `containerDefinitions` section of the task definition.
#
# 4. Store an IAM user access key in GitHub Actions secrets named `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.
# See the documentation for each action used below for the recommended IAM policies for this IAM user,
# and best practices on handling the access key credentials.

on:
workflow_dispatch:
inputs: null

name: Deploy API to AWS - dev

jobs:
deploy:
env:
server: dev
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: pephub_dev
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG -f deployment/pephub.databio.org/Dockerfile_dev .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
echo "image=$REGISTRY/$REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: deployment/task_defs/dev.json
container-name: pephub-container
image: ${{ steps.build-image.outputs.image }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: pephub-service-dev
cluster: yeti
wait-for-service-stability: true
5 changes: 1 addition & 4 deletions .github/workflows/deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
# and best practices on handling the access key credentials.

on:
push:
branches:
- master
workflow_dispatch:
inputs: null

Expand Down Expand Up @@ -60,7 +57,7 @@ jobs:
REPOSITORY: pephub
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG -f deployment/pephub.databio.org/Dockerfile .
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG -f deployment/pephub.databio.org/Dockerfile_primary .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
echo "image=$REGISTRY/$REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/deploy-dockerhub-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build and push dev image to Dockerhub

on:
workflow_dispatch:
inputs: null

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

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

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

- name: Build and Push to DockerHub
uses: docker/build-push-action@v5
with:
push: true
file: deployment/dockerhub/dev.Dockerfile
tags: "databio/pephub:dev"
9 changes: 4 additions & 5 deletions .github/workflows/deploy-dockerhub.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Deploy to Dockerhub on release

on:
release:
types:
- created
types: [published]
workflow_dispatch:
inputs: null

name: Deploy to Dockerhub on release

jobs:
deploy:
name: Deploy
Expand All @@ -28,5 +27,5 @@ jobs:
uses: docker/build-push-action@v5
with:
push: true
file: deployment/dockerhub/Dockerfile
file: deployment/dockerhub/primary.Dockerfile
tags: databio/pephub:latest, databio/pephub:${{ github.ref_name }}
22 changes: 22 additions & 0 deletions deployment/dockerhub/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -------------
# BUILD BACKEND
# -------------
FROM python:3.10-slim
LABEL authors="Nathan LeRoy, Nathan Sheffield, Oleksandr Khoroshevskyi"

RUN apt-get update
RUN apt-get install -y gcc
RUN apt-get install -y libpq-dev
RUN apt-get install -y --no-install-recommends git

EXPOSE 5432
EXPOSE 6333
EXPOSE 80

WORKDIR /app
COPY . /app

RUN python -m pip install --upgrade pip
RUN pip install -r requirements/requirements-all.txt --no-cache-dir

CMD ["uvicorn", "pephub.main:app", "--host", "0.0.0.0", "--port", "80"]
2 changes: 2 additions & 0 deletions deployment/pephub.databio.org/Dockerfile_dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM databio/pephub:dev
# pass - nothing else is needed
116 changes: 116 additions & 0 deletions deployment/task_defs/dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"ipcMode": null,
"executionRoleArn": "arn:aws:iam::235728444054:role/ecsTaskExecutionRole",
"cpu": null,
"memory": null,
"family": "pephub-task",
"containerDefinitions": [
{
"name": "pephub-container",
"cpu": 32,
"memory": 6096,
"memoryReservation": 512,
"portMappings": [
{
"hostPort": 8121,
"protocol": "tcp",
"containerPort": 80
}
],
"secrets": [
{
"valueFrom": "POSTGRES_HOST_AWS",
"name": "POSTGRES_HOST"
},
{
"valueFrom": "PEPHUB_POSTGRES_DB_DEV",
"name": "POSTGRES_DB"
},
{
"valueFrom": "PEPHUB_POSTGRES_PASSWORD",
"name": "POSTGRES_PASSWORD"
},
{
"valueFrom": "PEPHUB_POSTGRES_USER",
"name": "POSTGRES_USER"
},
{
"valueFrom": "PEPHUB_GH_CLIENT_ID",
"name": "GH_CLIENT_ID"
},
{
"valueFrom": "PEPHUB_GH_CLIENT_SECRET",
"name": "GH_CLIENT_SECRET"
},
{
"valueFrom": "PEPHUB_GH_REDIRECT_URI",
"name": "REDIRECT_URI"
},
{
"valueFrom": "PEPHUB_BASE_URI",
"name": "BASE_URI"
},
{
"valueFrom": "QDRANT_HOST",
"name": "QDRANT_HOST"
},
{
"valueFrom": "QDRANT_PORT",
"name": "QDRANT_PORT"
},
{
"valueFrom": "QDRANT_ENABLED",
"name": "QDRANT_ENABLED"
},
{
"valueFrom": "QDRANT_COLLECTION",
"name": "QDRANT_COLLECTION"
},
{
"valueFrom": "QDRANT_API_KEY",
"name": "QDRANT_API_KEY"
}
],
"dnsSearchDomains": null,
"environmentFiles": null,
"logConfiguration": null,
"entryPoint": null,
"command": null,
"linuxParameters": null,
"environment": null,
"resourceRequirements": null,
"ulimits": null,
"dnsServers": null,
"mountPoints": [],
"workingDirectory": null,
"dockerSecurityOptions": null,
"volumesFrom": [],
"stopTimeout": null,
"image": "235728444054.dkr.ecr.us-east-1.amazonaws.com/my-ecr-repo:170afd5cf39d9799e926e1d0ebf40b9051fb731f",
"startTimeout": null,
"firelensConfiguration": null,
"dependsOn": null,
"disableNetworking": null,
"interactive": null,
"healthCheck": null,
"essential": true,
"links": null,
"hostname": null,
"extraHosts": null,
"pseudoTerminal": null,
"user": null,
"readonlyRootFilesystem": null,
"dockerLabels": null,
"systemControls": null,
"privileged": null
}
],
"placementConstraints": [],
"taskRoleArn": "ecsTaskExecutionRole",
"pidMode": null,
"requiresCompatibilities": ["EC2"],
"networkMode": "bridge",
"inferenceAccelerators": null,
"proxyConfiguration": null,
"volumes": []
}
5 changes: 2 additions & 3 deletions launch_docker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

docker run -p 80:80 \
docker run -p 8000:80 \
--env POSTGRES_HOST=$POSTGRES_HOST \
--env POSTGRES_DB=$POSTGRES_DB \
--env POSTGRES_USER=$POSTGRES_USER \
Expand All @@ -9,8 +9,7 @@ docker run -p 80:80 \
--env QDRANT_PORT=$QDRANT_PORT \
--env QDRANT_ENABLED=$QDRANT_ENABLED \
--env QDRANT_API_KEY=$QDRANT_API_KEY \
--env HF_MODEL=$HF_MODEL \
--env GH_CLIENT_ID=$GH_CLIENT_ID \
--env GH_CLIENT_SECRET=$GH_CLIENT_SECRET \
--env BASE_URI=$BASE_URI \
pephub
databio/pephub:dev
2 changes: 1 addition & 1 deletion pephub/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.14.3"
__version__ = "0.15.0_dev0"
16 changes: 12 additions & 4 deletions pephub/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def read_authorization_header(authorization: str = Header(None)) -> Union[dict,


def get_organizations_from_session_info(
session_info: Union[dict, None] = Depends(read_authorization_header)
session_info: Union[dict, None] = Depends(read_authorization_header),
) -> List[str]:
organizations = []
if session_info:
Expand All @@ -168,7 +168,7 @@ def get_organizations_from_session_info(


def get_user_from_session_info(
session_info: Union[dict, None] = Depends(read_authorization_header)
session_info: Union[dict, None] = Depends(read_authorization_header),
) -> Union[str, None]:
user = None
if session_info:
Expand Down Expand Up @@ -405,8 +405,16 @@ def get_namespace_info(


@cached(TTLCache(maxsize=100, ttl=5 * 60))
def get_pepdb_namespace_info(limit: int = 10) -> ListOfNamespaceInfo:
def get_pepdb_namespace_info(
page: int = 0,
page_size: int = 10,
order_by: str = "number_of_projects",
) -> ListOfNamespaceInfo:
"""
Get the information on the biggest namespaces in the database.
"""
return agent.namespace.info(limit=limit)
return agent.namespace.info(
page=page,
page_size=page_size,
order_by=order_by,
)
Loading
Loading