Skip to content

Commit

Permalink
chore: remove all remaining references to App Engine (#2895)
Browse files Browse the repository at this point in the history
Fully closes #973
We've been off App Engine for a while now. Cleaned up all the stray
references to App Engine:
- renamed `gcp/appengine` to `gcp/website`
- renamed the poetry environment `appengine-backend` to
`website-backend` (you'll have to recreate the environment)
- renamed targets in Makefile `appengine` -> `website`
- moved datastore `index.yaml` to new directory `gcp/datastore`
- removed the `deployment/gae` directory
- removed App Engine-specific checks from website handlers.
  - Moved website health check endpoint from `/_ah/warmup` to `/healthz`
- Updated various docs to no longer refer to App Engine
  • Loading branch information
michaelkedar authored Nov 26, 2024
1 parent eed6788 commit 5c74442
Show file tree
Hide file tree
Showing 101 changed files with 54 additions and 256 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ yapf -i <file>.py

```shell
gcloud auth login --update-adc
make run-appengine
make run-website
```

#### API
Expand Down
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ importer-tests:
alias-tests:
cd docker/alias && ./run_tests.sh

appengine-tests:
cd gcp/appengine && ./run_tests.sh
website-tests:
cd gcp/website && ./run_tests.sh

vulnfeed-tests:
cd vulnfeeds && ./run_tests.sh
Expand All @@ -42,15 +42,15 @@ api-server-tests:
lint:
tools/lint_and_format.sh

run-appengine:
cd gcp/appengine/frontend3 && npm install && npm run build
cd gcp/appengine/blog && hugo --buildFuture -d ../dist/static/blog
cd gcp/appengine && $(install-cmd) && GOOGLE_CLOUD_PROJECT=oss-vdb $(run-cmd) python main.py
run-website:
cd gcp/website/frontend3 && npm install && npm run build
cd gcp/website/blog && hugo --buildFuture -d ../dist/static/blog
cd gcp/website && $(install-cmd) && GOOGLE_CLOUD_PROJECT=oss-vdb $(run-cmd) python main.py

run-appengine-staging:
cd gcp/appengine/frontend3 && npm install && npm run build
cd gcp/appengine/blog && hugo --buildFuture -d ../dist/static/blog
cd gcp/appengine && $(install-cmd) && GOOGLE_CLOUD_PROJECT=oss-vdb-test $(run-cmd) python main.py
run-website-staging:
cd gcp/website/frontend3 && npm install && npm run build
cd gcp/website/blog && hugo --buildFuture -d ../dist/static/blog
cd gcp/website && $(install-cmd) && GOOGLE_CLOUD_PROJECT=oss-vdb-test $(run-cmd) python main.py

# Run with `make run-api-server ARGS=--no-backend` to launch esp without backend.
run-api-server:
Expand All @@ -59,4 +59,4 @@ run-api-server:
cd gcp/api && $(install-cmd) && GOOGLE_CLOUD_PROJECT=oss-vdb $(run-cmd) python test_server.py $(HOME)/.config/gcloud/application_default_credentials.json $(ARGS)

# TODO: API integration tests.
all-tests: lib-tests worker-tests importer-tests alias-tests appengine-tests vulnfeed-tests
all-tests: lib-tests worker-tests importer-tests alias-tests website-tests vulnfeed-tests
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ consists of:

| directory | what |
|-----------------|------|
| `deployment/` | Terraform, Cloud Deploy & App Engine config files <br /> A few Cloud Build config yamls <br /> Old (no longer used?) `api-staging` and `api-test` Cloud Run configs |
| `deployment/` | Terraform & Cloud Deploy config files <br /> A few Cloud Build config yamls <br /> Old (no longer used?) `api-staging` and `api-test` Cloud Run configs |
| `docker/` | CI docker files (`ci`, `deployment`, `terraform`) <br /> Workers for bisection and impact analysis (`worker`, `importer`, `exporter`, `alias`, `worker-base`) <br /> The determine version `indexer`<br /> `cron/` jobs for database backups and processing oss-fuzz records |
| `docs/` | Jekyll files for https://google.github.io/osv.dev/ <br /> `build_swagger.py` and `tools.go` |
| `gcp/api` | OSV API server files (including files for the local ESP server) <br /> protobuf files in `/v1`|
| `gcp/appengine` | The backend of the osv.dev web interface, with the frontend in `frontend3` <br /> Blog posts (in `blog`) <br /> App Engine Cron Handlers (to be removed) <br /> The datastore indexes file (`index.yaml`) |
| `gcp/datastore` | The datastore index file (`index.yaml`) |
| `gcp/functions` | The Cloud Function for publishing PyPI vulnerabilities (maintained, but not developed) |
| `gcp/website ` | The backend of the osv.dev web interface, with the frontend in `frontend3` <br /> Blog posts (in `blog`) |
| `osv/` | The core OSV Python library, used in basically all Python services <br /> OSV ecosystem package versioning helpers in `ecosystems/` <br /> Datastore model definitions in `models.py` |
| `tools/` | Misc scripts/tools, mostly intended for development (datastore stuff, linting) <br /> The `indexer-api-caller` for indexer calling |
| `vulnfeeds/` | Go module for (mostly) the NVD CVE conversion <br /> The Alpine feed converter (`cmd/alpine`) <br /> The Debian feed converter (`tools/debian`, which is written in Python) |
Expand Down
4 changes: 2 additions & 2 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ steps:
waitFor: ['init', 'importer-tests']

- name: 'gcr.io/oss-vdb/ci'
id: 'appengine-tests'
dir: gcp/appengine
id: 'website-tests'
dir: gcp/website
args: ['bash', '-ex', 'run_tests.sh']
env:
# Each concurrent test that uses the datastore emulator must have a unique port number
Expand Down
2 changes: 1 addition & 1 deletion deployment/build-and-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['buildx', 'build', '--build-arg', 'BUILDKIT_INLINE_CACHE=1',
'-t', 'gcr.io/oss-vdb/osv-website:latest', '-t', 'gcr.io/oss-vdb/osv-website:$COMMIT_SHA',
'-f', 'gcp/appengine/Dockerfile', '--cache-from', 'gcr.io/oss-vdb/osv-website:latest', '--pull', '.']
'-f', 'gcp/website/Dockerfile', '--cache-from', 'gcr.io/oss-vdb/osv-website:latest', '--pull', '.']
env:
- BUILDKIT_PROGRESS=plain
id: 'build-website'
Expand Down
4 changes: 2 additions & 2 deletions deployment/clouddeploy/osv-website/run-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ spec:
value: '6379'
startupProbe:
httpGet:
path: /_ah/warmup # TODO(michaelkedar): Better endpoint for these
path: /healthz
livenessProbe:
httpGet:
path: /_ah/warmup
path: /healthz
resources:
limits:
cpu: 1
Expand Down
4 changes: 2 additions & 2 deletions deployment/clouddeploy/osv-website/run-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ spec:
value: '6379'
startupProbe:
httpGet:
path: /_ah/warmup # TODO(michaelkedar): Better endpoint for these
path: /healthz
livenessProbe:
httpGet:
path: /_ah/warmup
path: /healthz
resources:
limits:
cpu: 1
Expand Down
51 changes: 0 additions & 51 deletions deployment/gae/oss-vdb-test/app.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions deployment/gae/oss-vdb-test/cron-service.yaml

This file was deleted.

51 changes: 0 additions & 51 deletions deployment/gae/oss-vdb/app.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions deployment/gae/oss-vdb/cron-service.yaml

This file was deleted.

51 changes: 0 additions & 51 deletions deployment/gae/oss-vdb/testing-app.yaml

This file was deleted.

11 changes: 5 additions & 6 deletions docs/contributing/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ The [API server] runs on [Cloud Run], and is served by [Cloud Endpoints].
[Cloud Run]: https://cloud.google.com/run
[Cloud Endpoints]: https://cloud.google.com/endpoints

## App Engine
## Website

The [main web UI] runs on [App Engine]. App Engine [cron jobs] also schedule
recurring tasks for the workers, allocate OSV IDs, and make vulnerabilities
public at the appropriate times.
The [main web UI] also runs on [Cloud Run], and is served through
[Cloud Load Balancing].

[main web UI]: https://osv.dev
[App Engine]: https://github.com/google/osv/tree/master/gcp/appengine
[cron jobs]: https://github.com/google/osv/blob/master/gcp/appengine/cron.yaml
[Cloud Run]: https://cloud.google.com/run
[Cloud Load Balancing]: https://cloud.google.com/load-balancing
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions gcp/appengine/Dockerfile → gcp/website/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ FROM node:20.18@sha256:a7a3b7ec6de4b11bb2d673b31de9d28c6da09c557ee65453672c8e4f7
WORKDIR /build/frontend3

# Install dependencies first for better caching
COPY gcp/appengine/frontend3/package.json gcp/appengine/frontend3/package-lock.json ./
COPY gcp/website/frontend3/package.json gcp/website/frontend3/package-lock.json ./
RUN npm ci

COPY gcp/appengine/frontend3/webpack.prod.js ./
COPY gcp/appengine/frontend3/img img
COPY gcp/appengine/frontend3/src src
COPY gcp/website/frontend3/webpack.prod.js ./
COPY gcp/website/frontend3/img img
COPY gcp/website/frontend3/src src

RUN npm run build:prod

Expand All @@ -17,7 +17,7 @@ RUN npm run build:prod
FROM gcr.io/oss-vdb/ci AS HUGO_BUILD

WORKDIR /build/blog
COPY gcp/appengine/blog ./
COPY gcp/website/blog ./

RUN hugo --buildFuture -d ../dist/static/blog

Expand All @@ -33,21 +33,21 @@ ENV POETRY_VIRTUALENVS_IN_PROJECT=true

# Allow statements and log messages to immediately appear in the logs
ENV PYTHONUNBUFFERED True
WORKDIR /osv/gcp/appengine
WORKDIR /osv/gcp/website

# Install Python dependencies
COPY setup.py poetry.lock pyproject.toml README.md /osv/
COPY osv /osv/osv
COPY gcp/appengine/poetry.lock gcp/appengine/pyproject.toml ./
COPY gcp/website/poetry.lock gcp/website/pyproject.toml ./
RUN pip3 install poetry==1.8.3 && poetry install

# Website Python code
COPY gcp/appengine/*.py ./
COPY gcp/website/*.py ./

# JS/hugo builds
COPY gcp/appengine/dist/public_keys dist/public_keys
COPY gcp/appengine/docs docs
# gcp/appengine/docs/docs/osv_service_v1.swagger.json is a symlink
COPY gcp/website/dist/public_keys dist/public_keys
COPY gcp/website/docs docs
# gcp/website/docs/docs/osv_service_v1.swagger.json is a symlink
COPY docs/osv_service_v1.swagger.json docs/

COPY --from=FRONTEND3_BUILD /build/dist/ dist/
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ If you want to use images in your blog post, please do the following.

## Testing changes

Run the appengine frontend by following the steps
Run the website frontend by following the steps
[here](https://github.com/google/osv.dev/blob/master/CONTRIBUTING.md#ui), and
navigate to <!-- markdown-link-check-disable-line --> <http://localhost:8000/blog/>.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion gcp/appengine/build.sh → gcp/website/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# limitations under the License.

cd ../.. &&
docker build -t gcr.io/oss-vdb/osv-website:$1 -t gcr.io/oss-vdb/osv-website:latest -f gcp/appengine/Dockerfile --pull .
docker build -t gcr.io/oss-vdb/osv-website:$1 -t gcr.io/oss-vdb/osv-website:latest -f gcp/website/Dockerfile --pull .
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5c74442

Please sign in to comment.