Infrastructure

Nginx, servingwhat the runs wrote

Every artifact on the volume, reachable at a URL.And the configuration is a file on that volume too.

Nginx 1.30.42 cores · 1 GBServed on 8080
hub://nginx

$ dxflow workflow create --identity web hub://nginx --start --link

01Pick a machinecores, memory and a rate per hour
02Create the workflowpulled from the hub, once
03Run it, then stopstopped when the work is done
The application

An output directory,with an address

It is pointed at the volume, so what a run left behind is a web resource.

A URL for each file

Directory listings, byte ranges and downloads that resume where they stopped.

It opens, not downloads

A .log, .csv or solver input reads in the browser — the MIME table knows them.

Read from elsewhere

CORS=on lets a notebook or a dashboard fetch a result set cross-origin.

How you run it

The config liveson the volume

Write a location file, wait a few seconds, and it is serving. No restart, no redeploy.

SITE_DIR and CONFIG_DIRWhat gets published, and where the configuration is read from. Keep the second one outside the first.
PASSWORDBasic auth over the site. It ships as dxflow; setting it to nothing is what makes the site public.
AUTOINDEX and CORSDirectory listings are on. Turn CORS on when a notebook or dashboard needs to fetch a result set across origins.
RELOAD_INTERVALHow often the config directories are hashed and compared. Five seconds between saving a file and it being live.
WORKER_PROCESSESauto reads the cpu the step was actually given, from the cgroup, rather than the host's core count.
WORKER_USERnginx can read what other steps wrote under a normal umask. Use root for an artifact written 0600.
a location, live in five seconds

$ dxflow artifact upload reports.conf nginx/server.d/

$ dxflow artifact download nginx/state/status.log ./

$ dxflow workflow start web --override env.app.SITE_DIR=reports --link

The session

Configurationas an artifact

conf.d and server.d sit on the volume, and the step watches them.

8080Webthe site, or SITE_DIR
nginx/Configon the volume, watched
Write it, then waitUpload a location block and it is serving a few seconds later, no restart.
A broken one never landsEvery candidate is tested first, and the running server carries on serving.
Good to know

A broken confignever reaches disk

Every candidate is tested before it is installed, so the running server keeps serving through your mistakes.

Tested, then copied

nginx -t runs against a temporary path first. Only what passes is written, so a restart mid-edit still comes up.

It reports back in files

state/status.log says what happened to your last edit, and state/effective.conf holds what nginx actually resolved.

CORS and PASSWORD do not mix

A browser refuses a wildcard origin on a credentialed request. Leave the password empty, or turn auth off on the one location being fetched.

The image

Pulled once,then it stays

Nginx arrives as one image. This is what comes down the first time, and what the disk should have free for it.

63Mamd64compressed, the way the registry counts it
62Marm64compressed, the way the registry counts it
10GOn diskunpacked, with room to work beside it
ghcr.io/dxflow-ai/nginx:latestPublished from the hub, pulled on the first start and kept for the ones after it.
Either architectureamd64 and arm64 are both published, and the machine pulls the one it runs.
What it asks for

What it wants,and what it needs

The definition asks for 2 cores and 1 GB. The image comes up on less than that, and a start given --fit trims the ask to whatever the machine actually has.

2 cores · 1 GBAsks forwhat the definition writes down
1 cores · 1 GBRuns onthe least the image comes up on
Not neededGPUit works on the cores alone
The ask is not the floorThe definition writes down what suits the work. The image itself starts on less, which is what the second figure is.
--fit caps it to the hostA start given --fit trims each step to what the machine actually has, for that start alone. The definition is never rewritten.

Machines that fit it

Nginx asks for 2 cores and 1 GB. Cheapest first.

E2 Small
$0.0209/ hour2 cores · 2 GBStart this machine
E2 Medium
$0.0419/ hour2 cores · 4 GBStart this machine
T3 Medium
$0.052/ hour2 cores · 4 GBStart this machine
Run Nginx on your own machinePick a machine that meets it, and it opens about a minute after you ask.