Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small CI fixes #2855

Merged
merged 8 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-calitp-data-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
check_and_build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-calitp-data-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
check_and_build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-calitp-map-utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
check_and_build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-dask-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
build_push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-dbt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
check:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
check:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-gtfs-rt-archiver-v3-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
check:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-gtfs-rt-parser-v2-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
check:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
check:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-jupyter-singleuser-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
build_push:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ jobs:
- uses: crate-ci/typos@master
with:
files: ./docs/**
- uses: snok/install-poetry@v1
- name: mypy ci
working-directory: ci
run: |
poetry install
poetry run mypy tasks.py --check-untyped-def
2 changes: 1 addition & 1 deletion apps/maps/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "calitp_map_utils"
version = "2023.6.6"
version = "2023.8.1"
description = ""
authors = ["Andrew Vaccaro <[email protected]>"]
readme = "README.md"
Expand Down
8 changes: 6 additions & 2 deletions ci/channels/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ calitp:
secrets:
- jupyterhub_jupyterhub-gcloud-service-key
- jupyterhub_jupyterhub-github-config
timeout: 10m0s
- name: loki
driver: helm
namespace: monitoring-loki
Expand All @@ -41,8 +42,6 @@ calitp:
helm_chart: kubernetes/apps/charts/metabase
helm_values:
- kubernetes/apps/values/metabase.yaml
secrets:
- metabase_service_account_key
- name: postgresql-backup-grafana
driver: helm
namespace: monitoring-grafana
Expand Down Expand Up @@ -99,3 +98,8 @@ calitp:
secrets:
- sentry_sentry-secret
- sentry_sentry-sentry-postgresql
- name: dask
driver: helm
namespace: dask
helm_name: dask
helm_chart: kubernetes/apps/charts/dask
34 changes: 24 additions & 10 deletions ci/tasks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import tempfile
from enum import Enum
from pathlib import Path
from typing import List, Optional
from typing import List, NoReturn, Optional

import git
import yaml
Expand All @@ -15,6 +15,10 @@
}


def _assert_never(x: NoReturn) -> NoReturn:
assert False, "Unhandled type: {}".format(type(x).__name__)


class ReleaseDriver(str, Enum):
helm = "helm"
kustomize = "kustomize"
Expand All @@ -33,6 +37,7 @@ class Release(BaseModel):
helm_name: Optional[str]
helm_chart: Optional[Path]
helm_values: List[Path] = []
timeout: Optional[str]

# for kustomize
kustomize_dir: Optional[Path]
Expand Down Expand Up @@ -128,14 +133,12 @@ def secrets(
f.write(secret_contents)
print(f"Applying {release_secret}...", flush=True)
result = c.run(
f"kubectl apply {ns_str} -f {secret_path}", hide=hide, warn=True
f"kubectl apply {ns_str} -f {secret_path}",
hide=hide,
warn=True,
)
if result.exited:
print(
f"FAILURE: Failed to apply secret {release_secret}.",
flush=True,
)
raise Exit
raise Exit(f"FAILURE: Failed to apply secret {release_secret}.")
print(f"Successfully applied {release_secret}.", flush=True)
found_secret = True

Expand Down Expand Up @@ -181,6 +184,7 @@ def diff(
for values_file in release.helm_values
]
)
assert release.helm_name is not None
result = c.run(
" ".join(
[
Expand Down Expand Up @@ -251,9 +255,19 @@ def release(
c.run(f"kubectl create ns {release.namespace}")
verb = "install"

assert release.helm_name is not None
c.run(
f"helm {verb} {release.helm_name} {chart_path} --namespace {release.namespace} {values_str}"
" ".join(
[
"helm",
verb,
release.helm_name,
str(chart_path),
f"--namespace {release.namespace}",
values_str,
f"--timeout {release.timeout}" if release.timeout else "",
]
)
)
else:
print(f"Encountered unknown driver: {release.driver}", flush=True)
raise RuntimeError
_assert_never(release.driver)
Loading
Loading