Skip to content

Commit

Permalink
Docker compose update: migrate to new container name syntax (#557)
Browse files Browse the repository at this point in the history
* skyportal_web_1 -> skyportal-web-1 to work with new versions of docker compose

* update docker-compose cmd to docker compose

* pin kowalski to cc5304c600423ced63197d40ef657a7a6cc952ee

* update redoc-cli version used

* add some amount of caching to the ci for the docs
  • Loading branch information
Theodlz authored Aug 8, 2024
1 parent e50265b commit 3de0dc1
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 23 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build-test-doc_upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ jobs:
with:
node-version: 20

- uses: actions/cache@v2
with:
path: |
~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('package.json') }}

- uses: actions/cache@v2
with:
path: |
~/.cache/pip
key: ${{ runner.os }}-${{ hashFiles('**/requirements*.txt') }}

- name: Install system dependencies
run: |
sudo apt update -y && sudo apt install -y libcurl4-gnutls-dev libgnutls28-dev
Expand Down
8 changes: 4 additions & 4 deletions fritz.defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,18 @@ skyportal:

kowalski:
protocol: http
host: kowalski_api_1
host: kowalski-api-1
port: 4000
token:
# a (dedicated) Kowalski instance holding the ZTF light curve data referred to as Gloria
gloria:
protocol: http
host: kowalski_api_1
host: kowalski-api-1
port: 4000
token:
melman:
protocol: http
host: kowalski_api_1
host: kowalski-api-1
port: 4000
token:

Expand Down Expand Up @@ -1924,7 +1924,7 @@ kowalski:

skyportal:
protocol: "http"
host: skyportal_web_1
host: skyportal-web-1
port: 5000
username: kowalski
token: <token>
Expand Down
6 changes: 3 additions & 3 deletions launcher/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def build(
# start up skyportal
# docker-compose.skyportal.yaml bind-mounts the fritz-specific config.yaml and db_seed.yaml
p = subprocess.run(
["docker-compose", "-f", "docker-compose.skyportal.yaml", "up", "-d"],
["docker", "compose", "-f", "docker-compose.skyportal.yaml", "up", "-d"],
cwd="skyportal",
check=True,
)
Expand All @@ -116,7 +116,7 @@ def build(
"docker",
"exec",
"-i",
"skyportal_web_1",
"skyportal-web-1",
"/bin/bash",
"-c",
"source /skyportal_env/bin/activate; make db_clear; make db_init;"
Expand Down Expand Up @@ -169,7 +169,7 @@ def build(
if init:
# stop SkyPortal
subprocess.run(
["docker-compose", "-f", "docker-compose.skyportal.yaml", "down"],
["docker", "compose", "-f", "docker-compose.skyportal.yaml", "down"],
cwd="skyportal",
)

Expand Down
2 changes: 1 addition & 1 deletion launcher/commands/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def doc(yes: bool = False, upload: bool = False):
subprocess.run(
[
"npx",
"redoc-cli@0.9.8",
"redoc-cli@0.13.21",
"bundle",
"openapi.json",
"--title",
Expand Down
2 changes: 1 addition & 1 deletion launcher/commands/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def log():
"docker",
"exec",
"-i",
"skyportal_web_1",
"skyportal-web-1",
"/bin/bash",
"-c",
"source /skyportal_env/bin/activate; make log",
Expand Down
4 changes: 2 additions & 2 deletions launcher/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def run(
# start up skyportal
# docker-compose.skyportal.yaml bind-mounts the fritz-specific config.yaml and db_seed.yaml
p = subprocess.run(
["docker-compose", "-f", "docker-compose.skyportal.yaml", "up", "-d"],
["docker", "compose", "-f", "docker-compose.skyportal.yaml", "up", "-d"],
cwd="skyportal",
check=True,
)
Expand Down Expand Up @@ -69,7 +69,7 @@ def run(
check_config_exists(cfg="docker-compose.traefik.defaults.yaml", yes=yes)
# fire up traefik
p = subprocess.run(
["docker-compose", "-f", "docker-compose.traefik.yaml", "up", "-d"],
["docker", "compose", "-f", "docker-compose.traefik.yaml", "up", "-d"],
check=True,
)
if p.returncode != 0:
Expand Down
6 changes: 4 additions & 2 deletions launcher/commands/stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ def stop():
traefik_is_running = any("traefik" in x.lower() for x in running_container_images)
if traefik_is_running:
print("Shutting down Traefik")
subprocess.run(["docker-compose", "-f", "docker-compose.traefik.yaml", "down"])
subprocess.run(
["docker", "compose", "-f", "docker-compose.traefik.yaml", "down"]
)

# stop Kowalski and SkyPortal
subprocess.run(["python", "kowalski.py", "down"], cwd="kowalski")
subprocess.run(
["docker-compose", "-f", "docker-compose.skyportal.yaml", "down"],
["docker", "compose", "-f", "docker-compose.skyportal.yaml", "down"],
cwd="skyportal",
)

Expand Down
12 changes: 6 additions & 6 deletions launcher/commands/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def test():
)
> 0
for container_name in (
"kowalski_ingester_1",
"kowalski_api_1",
"skyportal_web_1",
"kowalski-ingester-1",
"kowalski-api-1",
"skyportal-web-1",
)
)

Expand All @@ -62,7 +62,7 @@ def test():
if i == num_retries - 1:
raise RuntimeError("SkyPortal failed to spin up")

command = ["docker", "exec", "-i", "skyportal_web_1", "ps", "-ef"]
command = ["docker", "exec", "-i", "skyportal-web-1", "ps", "-ef"]
process_list = subprocess.check_output(command, universal_newlines=True).strip()

if "app.py" not in process_list:
Expand Down Expand Up @@ -113,7 +113,7 @@ def test():
"docker",
"exec",
"-i",
"skyportal_web_1",
"skyportal-web-1",
"cp",
"docker.yaml",
"test_config.yaml",
Expand All @@ -136,7 +136,7 @@ def test():
"docker",
"exec",
"-i",
"skyportal_web_1",
"skyportal-web-1",
"/bin/bash",
"-c",
"source /skyportal_env/bin/activate &&"
Expand Down
2 changes: 1 addition & 1 deletion launcher/skyportal.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get_token():
"docker",
"exec",
"-i",
"skyportal_web_1",
"skyportal-web-1",
"/bin/bash",
"-c",
"cat /skyportal/.tokens.yaml",
Expand Down
2 changes: 1 addition & 1 deletion skyportal
Submodule skyportal updated 92 files
+2 −2 .github/workflows/test_docker_build.yaml
+97 −0 alembic/versions/05bda3fff04d_add_release_to_public_source_pages.py
+60 −0 alembic/versions/b0f0b2a30357_event_advocate.py
+3 −1 doc/deploy.md
+9 −9 package.json
+7 −7 requirements.txt
+7 −6 services/gcn_service/gcn_service.py
+12 −1 skyportal/app_server.py
+5 −0 skyportal/facility_apis/_base.py
+13 −0 skyportal/facility_apis/atlas.py
+69 −0 skyportal/facility_apis/generic.py
+26 −0 skyportal/facility_apis/growth_india.py
+4 −0 skyportal/facility_apis/interface.py
+14 −0 skyportal/facility_apis/kait.py
+39 −14 skyportal/facility_apis/lco.py
+29 −37 skyportal/facility_apis/lt.py
+14 −0 skyportal/facility_apis/nicer.py
+94 −0 skyportal/facility_apis/observation_plan.py
+46 −0 skyportal/facility_apis/sedmv2.py
+19 −0 skyportal/facility_apis/slack.py
+29 −8 skyportal/facility_apis/soar.py
+18 −0 skyportal/facility_apis/swift.py
+10 −0 skyportal/facility_apis/tarot.py
+10 −0 skyportal/facility_apis/trt.py
+22 −0 skyportal/facility_apis/winter.py
+116 −0 skyportal/facility_apis/ztf.py
+4 −0 skyportal/handlers/api/__init__.py
+29 −0 skyportal/handlers/api/allocation.py
+43 −0 skyportal/handlers/api/candidate.py
+195 −18 skyportal/handlers/api/gcn.py
+2 −3 skyportal/handlers/api/observation_plan.py
+5 −0 skyportal/handlers/api/photometry.py
+307 −0 skyportal/handlers/api/public_pages/public_release.py
+76 −52 skyportal/handlers/api/public_pages/public_source_page.py
+1 −1 skyportal/handlers/api/shift.py
+14 −5 skyportal/handlers/api/source.py
+3 −3 skyportal/handlers/api/source_groups.py
+1 −1 skyportal/handlers/api/taxonomy.py
+2 −1 skyportal/handlers/public/__init__.py
+89 −0 skyportal/handlers/public/release.py
+83 −8 skyportal/handlers/public/source_page.py
+4 −0 skyportal/models/__init__.py
+16 −3 skyportal/models/followup_request.py
+47 −7 skyportal/models/gcn.py
+8 −0 skyportal/models/group_joins.py
+6 −2 skyportal/models/photometric_series.py
+61 −0 skyportal/models/public_pages/public_release.py
+60 −38 skyportal/models/public_pages/public_source_page.py
+1 −1 skyportal/models/spectrum.py
+7 −0 skyportal/models/user_token.py
+10 −5 skyportal/tests/api/candidates_sources_events/test_observation.py
+112 −0 skyportal/tests/api/candidates_sources_events/test_photometry.py
+326 −0 skyportal/tests/api/candidates_sources_events/test_public_source_pages.py
+1 −1 skyportal/tests/api/test_spectrum.py
+0 −110 skyportal/tests/flaky/test_photometry_api_flaky.py
+21 −2 skyportal/tests/frontend/sources_and_observingruns_etc/test_scanning_page.py
+1 −1 skyportal/tests/utils/test_spectrum_ascii_reader.py
+6 −2 skyportal/utils/earthquake.py
+10 −7 skyportal/utils/gcn.py
+200 −0 static/js/components/Notes.jsx
+4 −5 static/js/components/allocation/AllocationTable.jsx
+82 −6 static/js/components/allocation/NewAllocation.jsx
+9 −27 static/js/components/candidate/CandidatesPreferences.jsx
+17 −4 static/js/components/candidate/CandidatesPreferencesForm.jsx
+42 −16 static/js/components/candidate/FilterCandidateList.jsx
+64 −22 static/js/components/candidate/ScanningProfilesList.jsx
+141 −0 static/js/components/gcn/GcnAdvocates.jsx
+3 −3 static/js/components/gcn/GcnEventPage.jsx
+123 −0 static/js/components/release/ReleaseForm.jsx
+152 −0 static/js/components/release/ReleasesList.jsx
+33 −16 static/js/components/source/source_publish/SourcePublish.jsx
+56 −42 static/js/components/source/source_publish/SourcePublishHistory.jsx
+1 −1 static/js/components/source/source_publish/SourcePublishOptions.jsx
+132 −0 static/js/components/source/source_publish/SourcePublishRelease.jsx
+2 −0 static/js/components/templates/HeaderContent.jsx.template
+22 −1 static/js/ducks/gcnEvents.js
+46 −0 static/js/ducks/public_pages/public_release.js
+26 −3 static/js/ducks/public_pages/public_source_page.js
+94 −0 static/public_pages/releases/release/release_template.css
+91 −0 static/public_pages/releases/release/release_template.html
+9 −0 static/public_pages/releases/release/release_template.js
+66 −0 static/public_pages/releases/releases_template.css
+78 −0 static/public_pages/releases/releases_template.html
+35 −0 static/public_pages/releases/releases_template.js
+14 −1 static/public_pages/sources/source/source_template.css
+11 −6 static/public_pages/sources/source/source_template.html
+1 −7 static/public_pages/sources/sources_template.css
+3 −5 static/public_pages/sources/sources_template.html
+6 −6 static/public_pages/sources/sources_template.js
+1 −1 static/public_pages/style.css
+3 −4 tools/data_loader.py
+1 −3 tools/prepare_seed_data.py
2 changes: 1 addition & 1 deletion tools/check_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def output(cmd):
),
"docker-compose": (
# Command to get version
["docker-compose", "--version"],
["docker", "compose", "version"],
# Extract *only* the version number
lambda v: re.search(r"\s*([\d.]+)", v).group(0).strip(),
# It must be >= 1.22.0
Expand Down

0 comments on commit 3de0dc1

Please sign in to comment.