Skip to content

Commit

Permalink
Merge pull request #114 from databio/dev
Browse files Browse the repository at this point in the history
Deployment updates
  • Loading branch information
khoroshevskyi authored May 2, 2024
2 parents 277310b + 63de649 commit 5197391
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 190 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/deploy-api-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,10 @@
# and best practices on handling the access key credentials.

on:
push:
branches:
- master
paths:
- deployment/config/api-dev.bedbase.org.yaml
workflow_dispatch:
inputs: null

workflow_run:
workflows: [ "Build and push dev image to Dockerhub" ]
types:
- completed
paths:
- deployment/config/api-dev.bedbase.org.yaml

name: Deploy to Amazon ECS - dev1

Expand All @@ -46,8 +38,6 @@ jobs:
name: Deploy
runs-on: ubuntu-latest

needs: [dockerhub-dev]

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -79,7 +69,7 @@ jobs:
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: task_defs/port82.json
task-definition: deployment/task_defs/port82.json
container-name: bedhost
image: ${{ steps.build-image.outputs.image }}

Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@
# and best practices on handling the access key credentials.

on:
push:
branches:
- master
workflow_dispatch:
inputs: null
paths:
- deployment/config/api.bedbase.org.yaml
workflow_dispatch:
inputs: null

name: Deploy to Amazon ECS - primary

Expand Down Expand Up @@ -70,7 +67,7 @@ jobs:
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: task_defs/port81.json
task-definition: deployment/task_defs/port81.json
container-name: bedhost
image: ${{ steps.build-image.outputs.image }}

Expand Down
50 changes: 0 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,53 +21,3 @@ It needs a path to the *bedbase configuration file*, which can be provided eithe
**DEV UI**: <a href="https://dev.bedhost.pages.dev/" target="_blank">https://dev.bedhost.pages.dev/</a>

**Source Code**: <a href="https://github.com/databio/bedhost/" target="_blank">https://github.com/databio/bedhost/</a>

---

## Running for development

Running with `uvicorn` provides auto-reload. To configure, this assumes you have previously set up `databio/secrets`.

1. Source `.env` file to populate the environment variables referenced in the configuration file.
2. Start `bedhost` using `uvicorn` and pass the configuration file via the `BEDBASE_CONFIG` env var.


```console
source ../bedbase.org/environment/production.env
BEDBASE_CONFIG=../bedbase.org/config/api.bedbase.org.yaml uvicorn bedhost.main:app --reload
```

You can change the database you're connecting to by using a different config file:
- Using a local config: `BEDBASE_CONFIG=../bbconf/tests/data/config.yaml uvicorn bedhost.main:app --reload`
- With new database: `BEDBASE_CONFIG=../bedbase.org/config/bedbase2.yaml uvicorn bedhost.main:app --reload`

Now, you can access the service at [http://127.0.0.1:8000](http://127.0.0.1:8000). Example endpoints:
- 127.0.0.1:8000/bed/78c0e4753d04b238fc07e4ebe5a02984/img/open_chromatin
- 127.0.0.1:8000/bed/78c0e4753d04b238fc07e4ebe5a02984/img_path/open_chromatin
- 127.0.0.1:8000/bed/78c0e4753d04b238fc07e4ebe5a02984/file/bedfile
- 127.0.0.1:8000/bed/78c0e4753d04b238fc07e4ebe5a02984/file_path/bedfile
- 127.0.0.1:8000/bed/78c0e4753d04b238fc07e4ebe5a02984/metadata
- 127.0.0.1:8000/bed/78c0e4753d04b238fc07e4ebe5a02984/metadata?attr_ids=md5sum&attr_ids=genome

----
## Running the server in Docker

### Building image

- Primary image: `docker build -t databio/bedhost -f .Dockerfile .`
- Dev image `docker build -t databio/bedhost:dev -f dev.Dockerfile .`
- Test image: `docker build -t databio/bedhost:dev -f test.Dockerfile .`

Existing images can be found [at dockerhub](https://hub.docker.com/r/databio/bedhost).

### Running container for development

Configuration settings and deployment instructions are in the `bedbase.org` repository.

---

## Deploying updates automatically

The `bedhost/databio` image is built by a github action. It will build and push the `latest` image whenever a release is made. It will also tag that release with a tag for the release name.

For the dev tag, you must deploy this through manual dispatch
2 changes: 1 addition & 1 deletion deployment/Dockerfiles/dev1.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM databio/bedhost:dev

COPY config/api-dev.bedbase.org.yaml /bedbase.yaml
COPY deployment/config/api-dev.bedbase.org.yaml /bedbase.yaml
ENV BEDBASE_CONFIG=/bedbase.yaml

RUN mkdir -p /data/outputs/bedstat_output
Expand Down
2 changes: 1 addition & 1 deletion deployment/Dockerfiles/primary.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM databio/bedhost:latest

COPY config/api.bedbase.org.yaml /bedbase.yaml
COPY deployment/config/api.bedbase.org.yaml /bedbase.yaml
ENV BEDBASE_CONFIG=/bedbase.yaml

RUN mkdir -p /data/outputs/bedstat_output
Expand Down
118 changes: 0 additions & 118 deletions deployment/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion ui/src/motions/landing-animations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { motion } from 'framer-motion';
import { PRIMARY_COLOR } from '../const';

const STROKE_WIDTH = 2;
const STROKE_SPEAD = 8;
const STROKE_SPEAD = 0;

export const InPaths = () => {
return (
Expand Down

0 comments on commit 5197391

Please sign in to comment.