You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+56Lines changed: 56 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,3 +65,59 @@ Then open <http://127.0.0.1:8000/app> in your browser. Rotate the sphere with yo
65
65
### 4. Inspect available surveys
66
66
67
67
NASA maintains the full survey catalogue at <https://skyview.gsfc.nasa.gov/current/cgi/survey.pl>. Any entry in the "Survey" column is compatible with the `--survey` option.
68
+
69
+
## ☁️ Continuous deployment on AWS EC2 (native runtime)
70
+
71
+
Every push to `main` now syncs the repository to an EC2 instance and restarts a systemd-managed uvicorn process—no containers required.
72
+
73
+
### 1. Prepare the EC2 host (one-time)
74
+
75
+
1. Launch an EC2 instance (Ubuntu 22.04+ or Amazon Linux 2023) with inbound access to TCP 8000 (or front it with an ALB/NGINX if you prefer port 80/443).
> AWS credentials are no longer required because the workflow connects directly over SSH.
105
+
106
+
### 3. How the pipeline deploys
107
+
108
+
1. GitHub Actions bundles `requirements.txt`, `src/`, `web/`, and `deploy/` into a tarball.
109
+
2. The tarball is uploaded to `/tmp/nasa-skyview/` on the EC2 host.
110
+
3. The remote script runs `deploy/deploy.sh`, which:
111
+
- Copies the code into `/opt/nasa-skyview/app`.
112
+
- Creates/updates a Python virtual environment in `/opt/nasa-skyview/venv`.
113
+
- Installs Python dependencies with `pip`.
114
+
- Installs/updates the systemd unit file `deploy/nasa-skyview.service`.
115
+
- Restarts the `nasa-skyview` service (serving on port 8000 by default).
116
+
117
+
Logs are written to `/var/log/nasa-skyview.log` and `/var/log/nasa-skyview.err`, and cached SkyView tiles persist in `/opt/nasa-skyview/outputs`.
118
+
119
+
To roll back, re-run the workflow on an earlier commit or SSH into the instance, check out the desired commit manually inside `/opt/nasa-skyview/app`, reinstall requirements, and restart the service (`sudo systemctl restart nasa-skyview`).
120
+
121
+
## 🛣️ Roadmap ideas
122
+
123
+
- Package the downloader as a service with caching and rate-limit protection.
0 commit comments