Skip to content

Commit

Permalink
chore(brick): pre-release 0.4.0
Browse files Browse the repository at this point in the history
Development pre-release 0.4.0
  • Loading branch information
esteinig authored Feb 10, 2024
2 parents e4ba55b + 7835a38 commit 4522dce
Show file tree
Hide file tree
Showing 71 changed files with 4,079 additions and 1,400 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATES/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve `BRICK` ❤️
title: ''
labels: 'bug'
assignees: 'esteinig'

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATES/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATES/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'feature'
assignees: 'esteinig'

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Example: I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATES/other_issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: Other
about: Any other issue you would like to raise
title: ''
labels: 'other'
assignees: 'esteinig'

---

9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATES/question_dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: Dev Question
about: Any questions about developing `BRICK`
title: ''
labels: ['question', 'dev']
assignees: 'esteinig'

---

9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATES/question_user.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: User Question
about: Any questions about using `BRICK`
title: ''
labels: ['question', 'user']
assignees: 'esteinig'

---

12 changes: 6 additions & 6 deletions .github/workflows/cicd-prod.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: CI/CD Production Deployment
# On creating a new release

name: CI/CD Production

on:
pull_request:
branches: [ main ]
types: [ closed ]
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')

steps:
- name: "Add GitHub to the SSH known hosts file"
Expand All @@ -26,4 +26,4 @@ jobs:
ssh-private-key: ${{ secrets.SSH_PRODUCTION_PRIVATE_KEY }}

- name: Deploy to production server
run: ssh -o UserKnownHostsFile=/home/runner/.ssh/known_hosts ${{ secrets.SSH_PRODUCTION_SERVER }} 'bash ${{ secrets.SSH_PRODUCTION_PATH }}/scripts/deploy.sh prod ${{ secrets.SSH_PRODUCTION_PATH }}'
run: ssh -o UserKnownHostsFile=/home/runner/.ssh/known_hosts ${{ secrets.SSH_PRODUCTION_SERVER }} 'bash ${{ secrets.SSH_PRODUCTION_PATH }}/scripts/deploy.sh prod ${{ secrets.SSH_PRODUCTION_PATH }} ${{ github.sha }}'
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# On pushing to a new release branch auto version bump is
# performed from latest release, changelog modified,
# versions modified (cocogitto) and a pull request
# for merging into main is created

name: CI/CD Release

on:
push:
branches:
- 'release/*'

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Conventional commits check
uses: oknozor/cocogitto-action@v3
with:
check-latest-tag-only: true

- name: Auto-bump semantic version for release
id: release
uses: oknozor/cocogitto-action@v3
with:
release: true

- name: Create a new branch for the pull request
run: |
NEW_BRANCH="pr-release-${{ steps.release.outputs.version }}"
git checkout -b $NEW_BRANCH
git push origin $NEW_BRANCH
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Merge release ${{ steps.release.outputs.version }}'
title: '[RELEASE] Merge release ${{ steps.release.outputs.version }} into main'
body: 'This is an automated pull request to merge changes from the release ${{ steps.release.outputs.version }} into the main branch.'
branch: "pr-release-${{ steps.release.outputs.version }}"
base: main
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: Test Development Workflow
name: Unit Tests

on:
push:
Expand Down
9 changes: 4 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 23.12.0
- repo: https://github.com/psf/black
rev: 24.1.0
hooks:
- id: black
language_version: python3.11

- id: black
language_version: python3
76 changes: 56 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
# BRICK
# BRICK <a href='https://github.com/esteinig'><img src='docs/brick.png' align="right" height="270" /></a>

[`BRIG`](https://github.com/happykhan/BRIG)-like interactive data visualization for bacterial whole genome annotation, comparison and exploration
[`BRIG`](https://github.com/happykhan/BRIG)-like interactive data visualization for prokaryotic genome annotation, comparison and exploration

## Overview

`BRICK` is under active development. Please note there is currently no guarantee for data persistence in the web application or backwards compatabiltity until major version release.
- [How to run `BRICK`](#overview)
- [Web application](#web-service-convenient)
- [Local application (Docker)](#local-application-easy)
- [Self-hosted application (Docker)](#server-application-advanced)
- [Development setup and workflow](#development)
- [Dependencies and citations](#dependencies)
- [Etymology](#etymology)
- [Contributors](#contributors)

## Web service (convenient)

At the moment, the most convenient way to get started is by using our web application ([https://brick.ink](https://brick.ink)).
At the moment, the most convenient way to get started is by using our hosted web application ([brick.ink](https://brick.ink)). Please note that the server is located in Australia - for a snappier experience you can [deploy the application stack](#local-application-easy) on your local machine.

Session visualizations and all session data, including uploaded files and working data expire after seven days and are deleted from database and storage. All data are stored anonymously and sessions can only be accessed using the unique identifier in the URL.

If you notice egregious bugs or styling issues, please [let us know]()! Testing is currently limited to `Linux` and `Firefox`.

### Files

In the current iteration of the web application there are some restrictions in place:

In the current iteration of the web application there are some restrictions in place until we upgrade to a larger server:
* File upload size is restricted to 20 MB, please let me know if this is not sufficient
* Files and working data have a total session limit of 200 MB

* File uploads and session data in the web application are automatically deleted seven days after creation
* File upload size is restricted to 20MB per file and a session has a maximum size of 200MB
### Sessions

Don't hesitate to come back to the session! While a session has not expired, you can:
Don't hesitate to come back to the session - while a session has not expired you can:

* Navigate away at any time and come back to the session using the session URL
* Share your (editable) session with colleagues using the session URL
* Download the session data (`.json`) to persist your visualization.
* Download the session data and re-hydrate your session in the data upload panel
* Share your (editable) session with colleagues by sending them the session URL

However, please note there is currently no guarantee for backwards compatability of downloaded session data until major version release.
`BRICK` is under active development. Please note there is currently no guarantee for data persistence in the web application or backwards compatabiltity until major version release.

## Local application (easy)

Expand All @@ -46,10 +61,18 @@ docker compose --profile prod up --build

## Server application (advanced)

You can self-host the application on a local or remote server - in this case my assumption is that you know what you are doing 👀

<details>

<summary>Expand to view self-hosting instructions</summary>

See the `docker` subdirectory for reverse-proxy and alternative service configurations using `Traefik`.

If you are hosting your own instance of the application on the web, my assumption is that you know what you are doing and have enough background knowledge to modify `docker/traefik/web/dynamic.yml` and `docker/docker-compose.web.yml`. Please ensure proper attribution if you are running your own web-instance, it helps to keep our main server running :heart:

Please note that some tools may require adjustments of the `docker/brick.env` application and server configuration file, in particular adjustment of the `BODY_SIZE_LIMIT` variable which controls the maximum size for requests including file uploads, and the `PRIVATE_CELERY_TASK_CHECK_TIMEOUT` variable, which controls how long we are checking for results from a task queue worker that processes a long-running task.

In this example, we are using the pre-configured `localhost` reverse-proxy to test deployment on a local machine (`http://brick.localhost/`), assuming there are no other reverse-proxy service running:

```bash
Expand Down Expand Up @@ -93,15 +116,25 @@ command: brick utils clean --expire-days 7 --day-of-week "*" --time-of-day '04:0
If you are running a web-instance through `Cloudflare` you need to set your SSL configuration to `full`.


</details>

## Development

Any and all questions, suggestions for improvement, bug reports, pull requests and ideas you would like to see implemented are welcome! Please open an [issue](https://github.com/esteinig/brick/issues) in this repository.

Development and pull requests can be made on the [`dev`](https://github.com/esteinig/brick/tree/dev) branch. You can use the `dev` profile for hot reloads of changes to the application interface. Note that the `dev` profile in `docker-compose.web.yml` actually deploys the production service, but on a different domain (to be implemented at `dev.brick.ink`).
<details>

<summary>Expand to view development notes and workflows</summary>

It often helps to run a fresh development stack with a project identifier to keep volumes and containers separate for the current branch. Project specific stack containers and volumes (all data) can be removed with the `-v` flag. Changes to the `Python` package currently have to use the `--build` flag to rebuild the package inside the `docker/Dockerfile.server` container.
Development workflows and notes are mainly are reminder to myself and anyone who would like to contribute - if you have any questions please feel free to open an issue or contact me through the usual channels.

Development and pull requests can be made on the [`dev`](https://github.com/esteinig/brick/tree/dev) branch. You can use the `dev` profile for hot reloads of changes to the application interface. Note that the `dev` profile in `docker-compose.web.yml` actually deploys the production service, but on a different domain, to be implemented (`dev.brick.ink`). For hot-reload of the Sveltekit interface the application should be installed first (`npm install`) so that you can point your IDE at the development clone and changes made to the `app` and `node_modules` folder are mirrored into the development container.

Note that the `--profile dev` stack serves the application on port `5174` **not on** `5173` (`--profile prod`) for concurrent production build testing.

It may help to run a fresh development stack with a project identifier to keep volumes and containers separate for the current branch. Project specific stack containers and volumes (all data) can be removed with the `-v` flag. Changes to the `Python` package currently have to use the `--build` flag to rebuild the package inside the `docker/Dockerfile.server` container.

Note that the `--profile dev` stack serves the application on port `5174` **not on** `5173` (`--profile prod`), so that it can be run concurrently for production build testing.

```bash
# You may be on a new feature branch `feat/new-feature`...
Expand All @@ -120,13 +153,15 @@ Unit tests are defined in `tests` can be run with the `tests` service:
docker compose build tests && docker compose run --rm tests
```

Release branches (`release/**`) can be used to auto bump version and generate the changelog for example byt using `git checkout -b release/$(cog bump --dry-run --auto) && cog bump --auto`. I am not sure if `cocogitto` is stable yet, it may be worthwhile checking version bumps before creating the branch with `cog bump --dry-run --auto`.
Release branches (`release/**`) can be used to auto bump version and generate the changelog for example by using `git checkout -b release/$(cog bump --dry-run --auto) && cog bump --auto`. I am not sure if `cocogitto` is stable yet, it may be worthwhile checking version bumps before creating the branch with `cog bump --dry-run --auto`. A new PR is created with the updated `CHANGELOG.md` and version bumps from `cocogitto`, which can then be merged into main (`release.yml`).

Releases are deployed to the production server on creation of a new release (`cicd-prod.yml`). Tests are run with the `test.yml` action workflow on push any test branch (`test/**`). One can create a release branch and before merging into `main` simply checkout and push a new test branch of the release to trigger the unit testing action for example `git checkout -b test/0.3.0 && git push origin test/0.3.0`.

Releases are deployed to the production server on merge into `main` using the `cicd-prod.yml` action workflow. Tests are run with the `test.yml` action workflow on push any test branch (`test/**`). One can create a release branch and before merging into `main` simply checkout and push a new test branch of the release to trigger the unit testing action for example `git checkout -b test/0.3.0 && git push origin test/0.3.0`.
</details>

## Dependencies

`BRICK` would not be possible without the amazing work of bioinformaticians and researchers who make their software available open-source.
`BRICK` would not be possible without the relentless work of bioinformaticians and researchers developing open-soource software for the community.
If you use their tools in the visualization, please cite the following publications:

> [Altschul et al. (1990)](https://pubmed.ncbi.nlm.nih.gov/2231712/) - Basic local alignment search tool - Journal of Molecular Biology
Expand All @@ -139,7 +174,7 @@ If you would like to acknowledge the authors of the original visualization, plea

> [Alikhan et al. (2011)](https://bmcgenomics.biomedcentral.com/articles/10.1186/1471-2164-12-402) - BLAST Ring Image Generator (BRIG): simple prokaryote genome comparisons - BMC Genomics
Similarly, the stack would not be possible without the following amazing tools:
Similarly, the stack would not be possible without the following wonderful tools:

* [Svelte/Sveltekit](https://kit.svelte.dev/)
* [Skeleton UI](https://www.skeleton.dev/)
Expand All @@ -150,8 +185,9 @@ Similarly, the stack would not be possible without the following amazing tools:

## Etymology

`BRICK` is not very brick-like... and **BR**IG-like **I**nteractive **C**ircular **K**nowledgebase is a bit of a stretch 👀
`BRICK` is not very brick-like... and **BR**IG-like **I**nteractive **C**ircular **K**nowledgebase is a bit of a stretch 👀

## Contributors

* Eike Steinig - @esteinig
* Eike Steinig - [@esteinig](https://github.com/esteinig)
* Wytamma Wirth - [@Wytamma](https://github.com/Wytamma)
Loading

0 comments on commit 4522dce

Please sign in to comment.