Skip to content

Commit

Permalink
Merge pull request #34 from bento-platform/releases/v3.7
Browse files Browse the repository at this point in the history
[WIP] v3.7 rc-1
  • Loading branch information
brouillette authored Jan 24, 2023
2 parents 027c860 + 9cb3416 commit 35ecacb
Show file tree
Hide file tree
Showing 55 changed files with 682 additions and 499 deletions.
1 change: 1 addition & 0 deletions .github/workflows/api.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches:
- master
- "releases/**" # temp
push:
branches:
- master
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vscode
.DS_store

*/bin
*/obj
Expand Down Expand Up @@ -31,7 +32,7 @@ authorization/policy.rego
authorization/*.policy.rego

# temp test file
src/tests/common/test.config.yml
src/api/tests/common/test.config.yml

# executables

Expand Down
40 changes: 17 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# Makefile for Gohan

# import global variables
env ?= .env

#>>>
# set default shell
#<<<
SHELL = bash

include $(env)
export $(shell sed 's/=.*//' $(env))

# export host user IDs for more secure
# containerization and volume mounting
export HOST_USER_UID=$(shell id -u)
export HOST_USER_GID=$(shell id -g)
export OS_NAME=$(shell uname -s | tr A-Z a-z)

export GOOS=${OS_NAME}
export GOARCH=$(shell if [ "$(uname -m)" == "aarch64" ]; then echo arm64; else echo $(uname -m); fi | tr A-Z a-z)

# import global variables
env ?= .env

include $(env)
export $(shell sed 's/=.*//' $(env))


# initialize services
init:
Expand All @@ -43,8 +46,7 @@ init-networks:

init-vendor:
@echo "Initializing Go Module Vendor"
cd src/api && go mod vendor
cd src/tests && go mod tidy && go mod vendor
cd src/api && go mod tidy && go mod vendor

init-data-dirs:
mkdir -p ${GOHAN_API_DRS_BRIDGE_HOST_DIR}
Expand Down Expand Up @@ -76,7 +78,7 @@ init-data-dirs:

# Run
run-all:
docker-compose -f docker-compose.yaml up -d --force-recreate
docker-compose -f docker-compose.yaml up -d

run-dev-all:
docker-compose -f docker-compose.dev.yaml up -d --force-recreate
Expand All @@ -85,8 +87,7 @@ run-dev-%:
docker-compose -f docker-compose.dev.yaml up -d --force-recreate $*

run-%:
docker-compose -f docker-compose.yaml up -d --force-recreate $*

docker-compose -f docker-compose.yaml up -d $*


# Build
Expand All @@ -111,10 +112,6 @@ build-api: stop-api clean-api
@echo "-- Building Golang-Api-Alpine Container --"
docker-compose -f docker-compose.yaml build api

build-drs: stop-drs clean-drs
@echo "-- Building DRS Container --"
docker-compose -f docker-compose.yaml build drs

build-authz: stop-authz clean-authz
@echo "-- Building Authorization Container --"
docker-compose -f docker-compose.yaml build authorization
Expand All @@ -130,7 +127,7 @@ stop-%:


# Clean up
clean-all: clean-networks clean-api clean-gateway clean-drs
clean-all: clean-networks clean-api clean-gateway

clean-networks:
docker network remove ${GOHAN_DOCKER_NET} &
Expand All @@ -144,10 +141,6 @@ clean-api:
docker rm ${GOHAN_API_CONTAINER_NAME} --force; \
docker rmi ${GOHAN_API_IMAGE}:${GOHAN_API_VERSION} --force;

clean-drs:
docker rm ${GOHAN_DRS_CONTAINER_NAME} --force; \
docker rmi ${GOHAN_DRS_IMAGE}:${GOHAN_DRS_VERSION} --force;

clean-authz:
docker rm ${GOHAN_AUTHZ_OPA_CONTAINER_NAME} --force; \
docker rmi ${GOHAN_AUTHZ_OPA_IMAGE}:${GOHAN_AUTHZ_OPA_IMAGE_VERSION} --force;
Expand Down Expand Up @@ -205,14 +198,15 @@ clean-api-drs-bridge-data:
## Tests
test-api-dev: prepare-test-config
@# Run the tests
cd src/api && \
go clean -cache && \
go test tests/integration/... -v
go test ./tests/integration/... -v

prepare-test-config:
@# Prepare environment variables dynamically via a JSON file
@# since xUnit doens't support loading env variables natively
envsubst < ./etc/test.config.yml.tpl > ./src/tests/common/test.config.yml
envsubst < ./etc/test.config.yml.tpl > ./src/api/tests/common/test.config.yml

clean-tests:
@# Clean up
rm ./src/tests/common/test.config.yml
rm ./src/api/tests/common/test.config.yml
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
# build services
make build-gateway
make build-drs
make build-api
# run services
Expand Down Expand Up @@ -148,7 +147,6 @@ make run-kibana

Run
```
make build-drs
make run-drs
```

Expand Down Expand Up @@ -320,6 +318,7 @@ Requests
> - upperBound : **number**
> - reference : **string** `an allele ( "A" | "C" | "G" | "T" | "N" or some combination thereof )`
> - alternative : **string** `an allele`
> - alleles : **string** `ordered comma-deliminated list of alleles (max: 2)`
> - ids : **string** `(a comma-deliminated list of variant ID alphanumeric codes)`
> - size : **number** `(maximum number of results per id)`
> - sortByPosition : **string** `(<empty> | asc | desc)`
Expand All @@ -334,6 +333,7 @@ Requests
> - upperBound : **number**
> - reference : **string** `an allele`
> - alternative : **string** `an allele`
> - alleles : **string** `ordered comma-deliminated list of alleles (max: 2)`
> - ids : **string** `(a comma-deliminated list of variant ID alphanumeric codes)`
> - genotype : **string** `( "HETEROZYGOUS" | "HOMOZYGOUS_REFERENCE" | "HOMOZYGOUS_ALTERNATE" )`
Expand All @@ -344,6 +344,7 @@ Requests
> - upperBound : **number**
> - reference : **string** `an allele`
> - alternative : **string** `an allele`
> - alleles : **string** `ordered comma-deliminated list of alleles (max: 2)`
> - ids : **string** `(comma-deliminated list of sample ID alphanumeric codes)`
> - size : **number** `(maximum number of results per id)`
> - sortByPosition : **string** `(<empty> | asc | desc)`
Expand All @@ -357,6 +358,7 @@ Requests
> - upperBound : **number**
> - reference : **string** `an allele`
> - alternative : **string** `an allele`
> - alleles : **string** `ordered comma-deliminated list of alleles (max: 2)`
> - ids : **string** `(comma-deliminated list of sample ID alphanumeric codes)`
> - genotype : **string** `( "HETEROZYGOUS" | "HOMOZYGOUS_REFERENCE" | "HOMOZYGOUS_ALTERNATE" )`
>
Expand Down Expand Up @@ -384,6 +386,7 @@ Generalized Response Body Structure
> "pos": `number`,
> "ref": `[]string`, // list of alleles
> "alt": `[]string`, // list of alleles
> "alleles": `[]string`, // ordereed list of alleles
> "info": [
> {
> "id": `string`,
Expand Down
11 changes: 0 additions & 11 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,6 @@ services:
retries: 3

drs:
build:
context: $PWD/drs
args:
BASE_IMAGE: ${GOHAN_DRS_BASE_IMAGE}
BASE_IMAGE_VERSION: ${GOHAN_DRS_BASE_IMAGE_VERSION}
REPO: ${GOHAN_DRS_REPO}
BRANCH: ${GOHAN_DRS_BRANCH}
TAG: ${GOHAN_DRS_TAG}
HOST_USER_UID: ${HOST_USER_UID}
HOST_USER_GID: ${HOST_USER_GID}
mem_limit: ${GOHAN_DRS_MEM_LIM} # for mem_limit to work, make sure docker-compose is v2.4
cpus: ${GOHAN_DRS_CPUS}
cpu_shares: 512
Expand All @@ -159,7 +149,6 @@ services:
- DATA=/drs/bento_drs/data/obj/ # DRS file objects, vs. the database
- INTERNAL_PORT=${GOHAN_DRS_INTERNAL_PORT}
volumes:
- ./drs/startup.sh:/drs/bento_drs/startup.sh
- ${GOHAN_DRS_DATA_DIR}:/drs/bento_drs/data
- ${GOHAN_API_DRS_BRIDGE_HOST_DIR}:${GOHAN_DRS_API_DRS_BRIDGE_DIR_CONTAINERIZED}
healthcheck:
Expand Down
77 changes: 0 additions & 77 deletions drs/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions drs/startup.sh

This file was deleted.

17 changes: 6 additions & 11 deletions etc/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

GOHAN_DEBUG=false
GOHAN_SERVICE_CONTACT=[email protected]
GOHAN_SEMVER=3.6.0
GOHAN_SEMVER=3.6.1
GOHAN_SERVICES="gateway api elasticsearch kibana drs authorization"

GOOS=linux
GOARCH=amd64
# GOOS=linux
# GOARCH=amd64

# Host
GOHAN_PUBLIC_PROTO=https
Expand Down Expand Up @@ -38,7 +38,7 @@ GOHAN_GATEWAY_CPUS=2
GOHAN_API_IMAGE=gohan-api
GOHAN_API_VERSION=latest

GOHAN_API_BUILDER_BASE_IMAGE=golang:1.15.15-alpine3.14
GOHAN_API_BUILDER_BASE_IMAGE=golang:1.19-alpine
GOHAN_API_BASE_IMAGE=alpine

GOHAN_API_CONTAINER_NAME=gohan-api
Expand Down Expand Up @@ -111,13 +111,8 @@ GOHAN_KB_ES_PORT=9200


# DRS
GOHAN_DRS_REPO=https://github.com/bento-platform/bento_drs
GOHAN_DRS_BRANCH=master
GOHAN_DRS_TAG=v0.5.1
GOHAN_DRS_BASE_IMAGE=python
GOHAN_DRS_BASE_IMAGE_VERSION=3.6-alpine
GOHAN_DRS_IMAGE=gohan-drs
GOHAN_DRS_VERSION=0.0.1
GOHAN_DRS_IMAGE=ghcr.io/bento-platform/bento_drs
GOHAN_DRS_VERSION=0.7.0
GOHAN_DRS_CONTAINER_NAME=gohan-drs
GOHAN_DRS_INTERNAL_PORT=5000
GOHAN_DRS_EXTERNAL_PORT=6000
Expand Down
2 changes: 1 addition & 1 deletion src/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RUN apk --update add ncurses-dev && \
rm -rf htslib samtools

# Build gohan api
RUN CGO_ENABLED=0 && \
RUN go mod vendor && \
go build -ldflags="-s -w" -o gohan_api
# Temporarily disabling:
#&& \
Expand Down
6 changes: 3 additions & 3 deletions src/api/contexts/contexts.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package contexts

import (
"api/models"
"api/services"
variantsService "api/services/variants"
"gohan/api/models"
"gohan/api/services"
variantsService "gohan/api/services/variants"

es7 "github.com/elastic/go-elasticsearch/v7"
"github.com/labstack/echo"
Expand Down
Loading

0 comments on commit 35ecacb

Please sign in to comment.