Skip to content

Commit

Permalink
Merge pull request #104 from refgenie/staging
Browse files Browse the repository at this point in the history
v0.6.0
  • Loading branch information
stolarczyk authored Mar 11, 2021
2 parents 05c8a48 + 87fcc6c commit 73984bc
Show file tree
Hide file tree
Showing 27 changed files with 2,313 additions and 267 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
4 changes: 3 additions & 1 deletion .github/workflows/deploy_release_software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ on:
release:
types:
- created

workflow_dispatch:
inputs: null

name: Deploy to Dockerhub on release

jobs:
Expand Down
35 changes: 25 additions & 10 deletions .github/workflows/deploy_staging_software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@


# 1. push the base refgenieserver image to dockerhub
# 2. check out the demo repo, then run the aws deploy
# 2a. build aws package with demo config file, push, deploy to cluster
# 2. check out the rg.databio.org repo, then run the aws deploy
# 2a. build aws package with rg.databio.org config file, push, deploy to cluster

on:
push:
Expand All @@ -36,13 +36,16 @@ on:
pull_request:
branches:
- staging
workflow_dispatch:
inputs: null

name: Deploy to Amazon ECS - software-staging

jobs:
deploy:
env:
server: software-staging
service: dev1
data-repo: rg.databio.org
name: Deploy
runs-on: ubuntu-latest
steps:
Expand All @@ -56,14 +59,15 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}
repository: databio/refgenieserver
tags: staging
dockerfile: staging.Dockerfile


- name: Checkout demo repo
uses: actions/checkout@v2
with:
repository: refgenie/refgenomes.databio.org
repository: refgenie/${{ env.data-repo }}
refs: refs/heads/master
path: server_data
path: ${{ env.data-repo }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand All @@ -86,23 +90,34 @@ jobs:
# Build a docker container and
# push it to ECR so that it can
# be deployed to ECS.
cd server_data
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f Dockerfiles/staging.Dockerfile .
cd ${{ env.data-repo }}
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f Dockerfiles/${{ env.data-repo }}.Dockerfile .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
- 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: task_defs/${{ env.server }}.json
task-definition: task_defs/${{ env.service }}.json
container-name: rgs-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: rgs-service-${{ env.server }}
cluster: hydra
service: rgs-service-${{ env.service }}
cluster: yeti
wait-for-service-stability: true
test:
needs: deploy
runs-on: ubuntu-latest
name: test REST API
steps:
- uses: actions/checkout@master
- uses: matt-ball/newman-action@master
name: Newman Action
with:
collection: refgenieserver.postman_collection.json
environment: refgenieserver.postman_environment.json
13 changes: 13 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

## [0.6.0] -- 2021-03-11
### Added
- API v3, which is a complete redesign and extension of the previous version
- in `refgenieserver archive`, when a `archive_checksum` is missing for a previously archived asset it will be recalculated.
- response models to API endpoints
- API version tags in the openAPI specification
- a `legacy_archive_digest` to the tag attributes

### Changed
- split the user interface into: index, genome and asset pages
- grouped endpoints by API version in the swagger docs
- the archives created with `refgenieserver archive` are now named after digests

## [0.5.1] -- 2020-07-10
### Changed
- in `refgenieserver archive`:
Expand Down
37 changes: 23 additions & 14 deletions dir2cfg_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@
import sys
import yaml
import argparse
from refgenconf import CFG_GENOMES_KEY, CFG_SERVER_KEY, CFG_FOLDER_KEY, CFG_ARCHIVE_KEY, CFG_ASSET_PATH_KEY
from refgenconf import (
CFG_GENOMES_KEY,
CFG_SERVER_KEY,
CFG_FOLDER_KEY,
CFG_ARCHIVE_KEY,
CFG_ASSET_PATH_KEY,
)


class _VersionInHelpParser(argparse.ArgumentParser):
def format_help(self):
""" Add version information to help text. """
return "version: {}\n".format(V) + super(_VersionInHelpParser, self).format_help()
return (
"version: {}\n".format(V) + super(_VersionInHelpParser, self).format_help()
)


def build_dir2yaml_parser():
Expand All @@ -19,24 +27,25 @@ def build_dir2yaml_parser():
:return argparse.ArgumentParser
"""
banner = "%(prog)s builds a refgenieserver config template for the directory structure." \
" Keep in mind that the produced config will require some adjustments."
banner = (
"%(prog)s builds a refgenieserver config template for the directory structure."
" Keep in mind that the produced config will require some adjustments."
)
additional_description = "\nhttps://github.com/databio/refgenieserver"

parser = _VersionInHelpParser(
description=banner,
epilog=additional_description)
parser = _VersionInHelpParser(description=banner, epilog=additional_description)

parser.add_argument(
"-V", "--version",
action="version",
version="%(prog)s {v}".format(v=V))
"-V", "--version", action="version", version="%(prog)s {v}".format(v=V)
)
parser.add_argument(
"-p", "--path",
"-p",
"--path",
dest="path",
help="A path to the directory that the YAML should be build for. If not provided, current working directory "
"will be used ({})".format(os.getcwd()),
default=None)
"will be used ({})".format(os.getcwd()),
default=None,
)
return parser


Expand Down Expand Up @@ -72,7 +81,7 @@ def main():
CFG_FOLDER_KEY: None,
CFG_SERVER_KEY: "http://www.refgenomes.databio.org",
CFG_ARCHIVE_KEY: None,
CFG_GENOMES_KEY: None
CFG_GENOMES_KEY: None,
}
rgc[CFG_GENOMES_KEY] = dir_as_dict(p)[os.path.basename(p)]
yaml.dump(rgc, f)
Expand Down
Loading

0 comments on commit 73984bc

Please sign in to comment.