Skip to content

Commit

Permalink
Add coordinator image to compose (#48)
Browse files Browse the repository at this point in the history
* Add coordinator image to compose

* Update ffmpeg

* Fix movie builder permissions

* Print container logs

* fix movie dockerfile typo

* remove cli, update containers

* Update CI

* Allow setting hostnames from environment

* Add .env to gitignore

* Setup .env in workflow

* Enable mod rewrite in web

* Update apache ver

* Remove stale test

* Delete removed test

* Fix typo

* update readme
  • Loading branch information
dgarciabriseno committed May 28, 2024
1 parent ee0d2c6 commit abbdeef
Show file tree
Hide file tree
Showing 20 changed files with 102 additions and 435 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Hostname to use in helioviewer configuration
HV_HOST=localhost
API_PORT=8081
CLIENT_PORT=8080
12 changes: 11 additions & 1 deletion .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
with:
submodules: 'recursive'

- name: Setup environment
run: mv .env.example .env

- name: Build containers
run: docker compose build

Expand All @@ -34,8 +37,15 @@ jobs:
- name: Check that containers start and become healthy
run: docker compose up -d --wait

- name: Print logs
if: always()
run: |
docker logs helioviewer-api-1
docker logs helioviewer-web-1
docker logs helioviewer-database-1
docker logs helioviewer-movies-1
- name: Test Helioviewer environment
run: |
bash tests/test_hgs2hpc_restarts.sh
bash tests/test_make_movie.sh
bash tests/test_aia_images.sh
3 changes: 3 additions & 0 deletions .github/workflows/push-to-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
with:
submodules: 'recursive'

- name: Setup environment
run: mv .env.example .env

- name: Build containers
run: docker compose build

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.devcontainer
test_setup_done
secrets
secrets
.env
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ Once installed clone this repo and run docker compose:
```bash
git clone --recurse-submodules https://github.com/Helioviewer-Project/helioviewer.org-docker.git
cd helioviewer.org-docker
mv .env.example .env
docker compose up -d --wait
```

It may take a while for the containers to be built and the application to start up.
Once the output from docker settles down, check that it's running by going to http://localhost:8080/

## Configuration

Configuration is made via the `.env` file. By default this is set to
bind and run everything on localhost. You can change this by editing `.env`

# Testing
For contributors to this environment, you can write tests to verify that the
Helioviewer environment is working. The `tests` folder contains scripts that
Expand Down
39 changes: 15 additions & 24 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: helioviewer
services:
database:
image: mariadb
image: dgarciabriseno/helioviewer-db-dev
build:
dockerfile: ./compose/dockerfiles/db.Dockerfile
environment:
MARIADB_ROOT_PASSWORD: helioviewer
ports:
Expand All @@ -12,20 +14,28 @@ services:
interval: 5s
timeout: 5s
retries: 3
volumes:
- jp2_volume:/tmp/jp2
redis:
image: redis
ports:
- 6379:6379
restart: on-failure
# Supporting python api for the helioviewer api
coordinator:
image: dgarciabriseno/hv-coordinator:0.1.0
api:
env_file:
- .env
image: dgarciabriseno/helioviewer-api-dev
build:
dockerfile: ./compose/dockerfiles/api_server.Dockerfile
ports:
- 8081:80
- ${API_PORT}:80
depends_on:
- database
- redis
- coordinator
restart: on-failure
platform: linux/amd64
healthcheck:
Expand All @@ -45,11 +55,13 @@ services:
target: /var/www/api.helioviewer.org
- api_logs:/var/www/api.helioviewer.org/log
web:
env_file:
- .env
image: dgarciabriseno/helioviewer-web-dev
build:
dockerfile: ./compose/dockerfiles/webserver.Dockerfile
ports:
- 8080:80
- ${CLIENT_PORT}:80
depends_on:
- api
restart: on-failure
Expand Down Expand Up @@ -77,27 +89,6 @@ services:
target: /var/www/api.helioviewer.org
- jp2_volume:/tmp/jp2
- cache:/var/www/helioviewer.org/cache
cli:
image: dgarciabriseno/helioviewer-cli-dev
build:
dockerfile: ./compose/dockerfiles/cli.Dockerfile
depends_on:
database:
condition: service_healthy
platform: linux/x86_64
healthcheck:
# Check every 10 seconds, wait up to 2 minutes
test: ["CMD", "ls", "/tmp/jp2/LASCO-C2/2023/12/01/white-light/"]
interval: 10s
timeout: 1s
retries: 12
volumes:
- type: volume
source: jp2_volume
target: /tmp/jp2
- type: bind
source: ./api
target: /home/admin/api

volumes:
jp2_volume:
Expand Down
176 changes: 0 additions & 176 deletions compose/Config.ini

This file was deleted.

67 changes: 0 additions & 67 deletions compose/Private.php

This file was deleted.

Loading

0 comments on commit abbdeef

Please sign in to comment.