Skip to content

Commit

Permalink
ci: added job to sync chart to central chart repo (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
chgl authored Jan 15, 2023
1 parent f4ff570 commit f07a089
Show file tree
Hide file tree
Showing 12 changed files with 223 additions and 147 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/helm-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
- name: Install Task
uses: arduino/setup-task@d665c6beebae46ff3f699d7b2fd3f1959de7153c # tag=1.0.2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Add helm repos and update deps
run: |
Expand Down
36 changes: 35 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:

- name: Install Task
uses: arduino/setup-task@d665c6beebae46ff3f699d7b2fd3f1959de7153c # tag=1.0.2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Cosign
uses: sigstore/cosign-installer@9becc617647dfa20ae7b1151972e9b3a2c338a2b # tag=v2.8.1
Expand All @@ -38,7 +40,6 @@ jobs:
task helm-add-repos
helm dep build charts/recruit
# TODO: maybe create a PR to miracum/charts with just the one folder's changes.
# TODO: maybe replace image tags in values.yaml with digests before packaging
- name: Package, upload, and sign Helm chart
run: |
Expand All @@ -57,6 +58,39 @@ jobs:
path: |
recruit-helm-chart.tgz
sync-helm-chart-to-central-chart-repo:
name: sync helm chart to central chart repo
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
with:
path: recruit

- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: miracum/charts
path: miracum-charts

- name: copy local helm chart to charts repo
run: |
cp -r recruit/charts/recruit miracum-charts/charts/
- name: get chart version
id: chart-version
run: |
CHART_VERSION=$(yq .version charts/recruit/Chart.yaml)
echo "version=${CHART_VERSION}" >> "$GITHUB_OUTPUT"
- uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # tag=v4.2.3
with:
token: ${{ secrets.MIRACUM_BOT_SEMANTIC_RELEASE_TOKEN }}
path: miracum-charts
title: "chore(deps): updated recruit chart to ${{ steps.chart-version.outputs.version }}"
branch: sync-recruit-chart-from-source-repo

prepare-artifacts:
name: prepare artifacts
runs-on: ubuntu-22.04
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-k8s-installation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ jobs:
- name: Install Task
uses: arduino/setup-task@d665c6beebae46ff3f699d7b2fd3f1959de7153c # tag=1.0.2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Add helm repos and update deps of recruit chart
run: |
Expand Down
5 changes: 5 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[allowlist]
description = "allow the keycloak aio export"
paths = [
'''aio-export.json'''
]
2 changes: 0 additions & 2 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ DISABLE_LINTERS:
- REPOSITORY_DEVSKIM
- SPELL_PROSELINT
- SPELL_CSPELL
- REPOSITORY_GITLEAKS
- JAVASCRIPT_STANDARD
- SQL_TSQLLINT
- PYTHON_PYLINT
- JAVA_PMD
- JAVA_CHECKSTYLE
- PYTHON_PYRIGHT
# error - python package "--hash" is available for public registration. /github/workspace/src/query/tests/e2e/requirements.txt
- REPOSITORY_DUSTILOCK
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/.staging.env
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ OMOP_JDBCURL=jdbc:postgresql://omopdb:5432/ohdsi
OMOP_PASSWORD=postgres
OMOP_RESULTSSCHEMA=cds_results
OMOP_USERNAME=postgres
QUERY_SCHEDULE_UNIXCRON=*/5 * * * *
QUERY_SCHEDULE_UNIXCRON="*/5 * * * *"
QUERY_SELECTOR_MATCHLABELS=UC1,Test
85 changes: 71 additions & 14 deletions docs/development/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,74 @@

All contributions are welcome!

Development and issue tracking is currently happening in the internal MIRACUM GitLab instance,
but all internal recruIT repositories are mirrored to the MIRACUM GitHub organization:

| recruIT module | GitLab Repository | GitHub Repository |
| ------------------------------------------- | ------------------------------------------------------- | -------------------------------------------------------------- |
| Documentation and Docker Compose deployment | _deprecated in favor of GitHub_ | <https://github.com/miracum/recruit> |
| Helm chart | _deprecated in favor of GitHub_ | <https://github.com/miracum/charts/tree/master/charts/recruit> |
| Screening List | <https://gitlab.miracum.org/miracum/uc1/recruit/list> | <https://github.com/miracum/recruit-list> |
| Query | <https://gitlab.miracum.org/miracum/uc1/recruit/query> | <https://github.com/miracum/recruit-query> |
| Notify | <https://gitlab.miracum.org/miracum/uc1/recruit/notify> | <https://github.com/miracum/recruit-notify> |

If you want to provide an external contribution, or report a bug or feature request,
please first create an issue on the corresponding GitHub repository (or the <https://github.com/miracum/recruit> repository)
and we can assist and discuss further.
## Setup for local development

From the `/src` directory:

```sh
docker compose -f hack/docker-compose.yaml up
```

This will start all development dependencies:

- OHDSI WebAPI
- OHDSI ATLAS
- Broadsea Atlasdb - a pre-filled OMOP database
- Traefik
- HAPI FHIR JPA Server
- Jaeger
- MailDev

If you want to start any of the recruIT modules as containers, you can specify the corresponding `--profile` switch.
For example, when working on the query module, it might be useful to run the screening list and the notify module
for debugging. The following will start all development dependencies as well as build and run the list and notify containers:

```sh
docker compose -f hack/docker-compose.yaml --profile=notify --profile=list up
```

You can then start the query module via gradle by running

```sh
./gradlew :query:bootRun
```

## Building Container Images

### notify & query

Both the notify and query module are Java applications that can be build using Gradle.
Therefore, they also share the same Dockerfile for building the container and can optionally
also be built using [jib](https://github.com/GoogleContainerTools/jib).

#### Using Dockerfile

From the `/src` directory, run

```sh
export MODULE_NAME=query
docker build -t "ghcr.io/miracum/recruit/${MODULE_NAME}:local" --build-arg=MODULE_NAME=${MODULE_NAME} .
```

The `--build-arg` `MODULE_NAME` must be either `notify` or `query` (default).

#### Using jib

You can also build the container images using [jib](https://github.com/GoogleContainerTools/jib) via gradle:

```sh
export MODULE_NAME=query
./gradlew :${MODULE_NAME}:jibDockerBuild --image="ghcr.io/miracum/recruit/${MODULE_NAME}:local"
```

Using `jibDockerBuild` will build the image against the local docker daemon. Running just `./gradlew :query:jib`
will attempt to push the image to the remote registry.

### list

The list module is a NodeJS app with a Vue frontend and can be built via Dockerfile.
From the `/src/list` directory, run:

```sh
docker build -t ghcr.io/miracum/recruit/list:local .
```
73 changes: 0 additions & 73 deletions src/DEVELOPMENT.md

This file was deleted.

4 changes: 4 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Development

See <https://miracum.github.io/recruit/development/contributing/> for
detailed instructions on working with the source code in this folder.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ spotless {
}

checkstyle {
toolVersion '10.3.3'
// configFile = file('../.checkstyle/checkstyle.xml')
toolVersion '10.6.0'
configFile = file('../config/checkstyle/checkstyle.xml')
}

jib {
Expand Down
File renamed without changes.
Loading

0 comments on commit f07a089

Please sign in to comment.