nandi/frqpublic Fork 0
5693bd54d43c2a63f33ffe43d67bc4909e271eb3
Commits
Clone
git clone https://git.rickub.com/nandi/frq.git
git clone ssh://git@rickub.com/nandi/frq.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

CI builds the image, Modal serves it 5693bd5 · on 5693bd54d43c2a63f33ffe43d67bc4909e271eb3 · nandi · 9h ago
README.md · 26 lines · 1.1 KBmarkdown
Blame HistoryOpen raw

web

FRQ_WEB_IMAGE=registry.gitlab.com/<ns>/frq/web:<sha> \
    modal deploy .modal/web/container.py

Defined by container.toml; ../_loader.py is what reads it, and
its comments are the spec.

Unlike dev, this container builds nothing. CI builds the image --
Dockerfile here, two stages, the second one just the bundle and a
python -- and pushes it to the GitLab registry; this deploys that
exact tag. So the thing served is the thing that was built and
tested, and a deploy is a pull rather than a compile.

runtime = "web": a Function whose [run] command listens on the one
[network] port, fronted by a stable https URL. modal deploy leaves
it up, and deploying again replaces it in place because the app is
named by [container] name.

Two credentials live outside the repo:

  • MODAL_TOKEN_ID / MODAL_TOKEN_SECRET, as protected CI variables.
  • A Modal Secret named gitlab-registry, holding REGISTRY_USERNAME
    and REGISTRY_PASSWORD -- a GitLab deploy token with
    read_registry. Modal pulls the private image on every cold start,
    not once at deploy time, so this has to be Modal's to keep.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# `web`

    FRQ_WEB_IMAGE=registry.gitlab.com/<ns>/frq/web:<sha> \
        modal deploy .modal/web/container.py

Defined by `container.toml`; `../_loader.py` is what reads it, and
its comments are the spec.

Unlike `dev`, this container builds nothing. CI builds the image --
`Dockerfile` here, two stages, the second one just the bundle and a
python -- and pushes it to the GitLab registry; this deploys that
exact tag. So the thing served is the thing that was built and
tested, and a deploy is a pull rather than a compile.

`runtime = "web"`: a Function whose [run] command listens on the one
[network] port, fronted by a stable https URL. `modal deploy` leaves
it up, and deploying again replaces it in place because the app is
named by `[container] name`.

Two credentials live outside the repo:

* `MODAL_TOKEN_ID` / `MODAL_TOKEN_SECRET`, as protected CI variables.
* A Modal Secret named `gitlab-registry`, holding `REGISTRY_USERNAME`
  and `REGISTRY_PASSWORD` -- a GitLab deploy token with
  `read_registry`. Modal pulls the private image on every cold start,
  not once at deploy time, so this has to be Modal's to keep.