Environment ยท Stage (NP)

Stage

The testing copy of the platform โ€” where changes are tried before they go live. “NP” means non-production. It runs on a single AWS server that does everything, and it’s the environment that gets deployed automatically. Currently at comingsoon.rocks, becoming travel.np.padi.com.

1EC2 server โ€” app & jobs together
db.t3.largeSingle PostgreSQL database
3Docker containers on the server
automatedDeployed via Ansible / a PR comment

Summary

At a glance

  • Domaincomingsoon.rocks → soon travel.np.padi.com
  • Regionus-west-2 (Oregon), AWS account 441054594441
  • Serveri-07f9b794bb3478d34 ยท 52.41.249.17 ยท t3a.xlarge
  • RunsThe app, the web server, and the background-jobs workers โ€” all on this one machine
  • DatabaseA single managed PostgreSQL instance (no cluster, no read replica)
  • DeploysAutomated โ€” make stage_deploy or a /cs comment on a pull request
In plain terms: Stage is a single, smaller machine running the whole platform end to end. It’s the safe place to test a release before it touches real customers.

The picture

How it fits together

Read top to bottom: a tester’s request comes in at the surface, hits the one server in the middle, and reads or writes the managed data at the bottom. Colours show where each piece runs.

AWS service On the server Container Outside service

What talks to what

FromToWhat flows
Tester / browserNginxPage & API requests (Nginx is reached directly)
BrowserCloudFront โ†’ S3Images, CSS, JS
NginxGunicorn / Node SSRRoutes each site to the right app process
Gunicorn (app)RDS PostgreSQLReads & writes (everything)
Gunicorn (app)Redis containerSessions, cache, cached queries
Gunicorn (app)ElasticsearchSearch & autosuggest
Gunicorn (app)ElastiCacheQueues background jobs
ElastiCacheCelery (same server)Workers pick up queued jobs
CeleryRDS, S3, outside servicesEmails, syncs, indexing

Detailed reference diagram

The full stage connection map from the architecture reference (scroll sideways to see it all).

100%Zoom, or open full screen, then scroll to explore. Vector diagram โ€” stays sharp at any size.
flowchart TB user(["User / tester"]) subgraph VPCN["๐ŸŸง AWS us-west-2 VPC (vpc-0cc15b7aโ€ฆ)"] subgraph SBOX["EC2 Stage NP โ€” i-07f9b794bb3478d34 (t3a.xlarge)<br/>Django + Celery combined"] direction TB ng2["๐ŸŸฆ Nginx + Gunicorn padi/long(/crawler)<br/>+ travel_next/ssr + static SPAs"] cel2["๐ŸŸฆ Celery high/mid/low/crowdin + beat + flower"] subgraph SDK["๐ŸŸฉ docker (3 โ€” no prometheus/node-exporter)"] r2[("Redis db2/3/5")] es2[("Elasticsearch 8.12.2")] k2["Kibana โš ๏ธ"] end end ec2[("๐ŸŸง ElastiCache<br/>stage-padi-travel-elastic-cache<br/>db0 broker ยท db1 results")] db2[("๐ŸŸง RDS stage-padi-travel<br/>db.t3.large โ€” single instance<br/>default + long (no reader)")] tr2[("๐ŸŸง RDS stage-padi-travel-ai-translations")] os2[("๐ŸŸง OpenSearch padi-travel-dsl-np<br/>t3.small, 1 node")] s3n[("๐ŸŸง S3 padi-travel-export-nonprod")] end user --> ng2 ng2 --> r2 & es2 & db2 & tr2 ng2 -- enqueue --> ec2 ec2 -- dequeue --> cel2 cel2 --> db2 & tr2 ng2 -. sync .-> os2 ng2 --> s3n

One machine, everything

The all-in-one server

In plain terms: on Stage there’s just one server. It runs the website app and the background workers together โ€” unlike Production, which splits them.
  • Instancei-07f9b794bb3478d34 ยท 52.41.249.17 ยท us-west-2a
  • Sizet3a.xlarge

Running directly on the server native

ServiceAddressWhat it does
Nginx:80 / :443The front door โ€” HTTPS and routing for the 5 sites.
Gunicorn “padi”127.0.0.1:7000The main app.
Gunicorn “long”127.0.0.1:6000Slow requests โ€” exports & admin.
travel_next / travel_ssr / extranet_ssr:3003 / :3001Server-side rendering for the consumer & operator sites.
Celery workers + beatโ€”Background jobs run here too (high/mid/low/crowdin + scheduler + Flower).
Static sitesvia NginxPre-built site files served from disk.
No separate crawler pool on Stage

The automated setup deploys the main app and the slow-request pool only. The extra bot-traffic pool is a Production-only thing โ€” it isn’t here.

Containers on this server 3 containers

ContainerPortWhat it holds / does
Redis redis:7.06379Sessions, cached queries, app cache.
Elasticsearch 8.12.29201โ†’9200Search & autosuggest.
Kibana5601A UI for Elasticsearch.

App logs stream to AWS CloudWatch under the padi-travel-np log group.

AWS ยท database

Database AWS

Stage uses a single managed PostgreSQL instance โ€” not a cluster. A separate small database holds AI translations.

DatabaseSizeHolds
RDS PostgreSQL
stage-padi-travel
db.t3.largeThe whole Stage database โ€” everything the app reads and writes.
RDS translations
stage-padi-travel-ai-translations
db.t4g.microAI-translation results & feedback (Stage copy).

Which part of the app uses which database

App connectionGoes toNotes
default / longstage-padi-travelAll reads & writes
replicastage-padi-travelNo separate replica on Stage โ€” the app safely falls back to the main database
translationsstage translations DBAI translation data
Partner read-replica routing can’t be tested here

The partner API is built to read from a separate replica. Stage has no replica, so those reads fall back to the main database โ€” automatically, with no error. To exercise true replica behaviour you need Production.

AWS + container

Caching & Redis

AWS ElastiCache

The job queue for background work. Cluster: stage-padi-travel-elastic-cache.

Redis container

The app cache โ€” sessions, cached queries and general cache, on the server itself.

Open item โ€” the queue host

AWS provisions the stage-padi-travel-elastic-cache queue, but the app’s stage config ships a placeholder for the queue address. The actual queue host used at runtime should be confirmed on the server.

AWS ยท storage

Files & storage AWS

Uploads, generated files and exports live in AWS S3.

BucketHolds
padi-travel-export-nonprodData exports for the Dive Shop Locator & shop integrations (Stage).
S3 media / staticUploaded images and site assets, served via the Stage CloudFront CDN.

AWS ยท Lambda

Serverless functions AWS

The same small functions exist in a non-production form, reading from the Stage OpenSearch and database:

Function (NP)What it doesReads from
Dive-site listingServes the dive-site listOpenSearch (NP)
Course locatorServes the course finderOpenSearch (NP) + database
Partner shop / authorizerShop data & partner token checksDatabase

How these are built and deployed (AWS CDK) is on the Deployments page.

Be aware

Notes & open items

ItemDetail
New domain comingStage is moving from comingsoon.rocks to travel.np.padi.com.
Queue host placeholder to confirmThe stage config has a placeholder for the job-queue address; confirm the real one on the server.
China QA siblingA related “Stage CN” environment (travel-qa.padi.com.cn) is configured and deployable the same way, but isn’t among the currently-running servers โ€” likely stopped.