Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs/improve-dev-infra-setup #229

Merged
merged 4 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cdp_backend/infrastructure/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ deploy-clipping key=default_key region=default_region:
--allow-unauthenticated

# run both setup and deploy
setup-and-deploy project region=default_region:
setup-and-deploy project region=default_region cookiecutter_yaml=default_cookiecutter_yaml:
just setup {{region}}
just deploy {{project}}
just deploy {{project}} cookiecutter_yaml={{cookiecutter_yaml}}

# fully teardown project
destroy project:
Expand All @@ -126,4 +126,4 @@ clean key=default_key:
# remove all database documents (including search index) and filestore objects
clean-full key=default_key:
clean_cdp_database {{key}} --clean-index
clean_cdp_filestore {{key}}
clean_cdp_filestore {{key}}
13 changes: 13 additions & 0 deletions cdp_backend/infrastructure/dev-cookiecutter-metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
default_context:
municipality: "CDP Dev Muni"
iana_timezone: "America/Los_Angeles"
governing_body_type: "other"
municipality_slug: "cdp-dev-muni"
python_municipality_slug: "cdp_dev_muni"
infrastructure_slug: "cdp_dev_muni_000001"
maintainer_or_org_full_name: "evamaxfield"
hosting_github_username_or_org: "CouncilDataProject"
hosting_github_repo_name: "cdp-dev-muni"
hosting_github_url: "https://github.com/CouncilDataProject/cdp-dev-muni"
hosting_web_app_address: "https://councildataproject.github.io/cdp-dev-muni"
firestore_region: "us-central"
37 changes: 30 additions & 7 deletions dev-infrastructure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ found in our

## Dependencies

Deploying the CDP infrastructure requires having `cdp-backend` installed.
Deploying the CDP infrastructure requires having `cdp-backend` installed along with the contributor tools.

For more detailed information please see the
[project installation details](https://github.com/CouncilDataProject/cdp-backend#installation).
[project installation details](https://github.com/CouncilDataProject/cdp-backend#installation) and [contributing details](https://github.com/CouncilDataProject/cdp-backend/blob/main/CONTRIBUTING.md).

## Account Setup

Expand All @@ -45,14 +45,17 @@ sure the [`gcloud` SDK](https://cloud.google.com/sdk/install) is installed.
_If this was the first time installing either of those packages, it is recommended to
restart your terminal after installation._

After `gcloud` has both been installed and terminal restarted, run the
following commands to log in to gcloud: `just login`

## Create a New Project and Deploy the Infrastructure

```bash
get_cdp_infrastructure_stack {OPTIONAL: dir path to store to}
get_cdp_infrastructure_stack {dir path to store to}
just login
just init {project-name}
```

Attach your billing account to the GCP project you just created in the [GCP console](https://console.cloud.google.com/).

```
just setup-and-deploy {project-name} {OPTIONAL: region}
```

Expand All @@ -72,12 +75,22 @@ just setup-and-deploy cdp-eva-dev-001
just deploy {project-name}
```

Or optionally passing cookiecutter yaml
```bash
just deploy {project-name} cookiecutter-yaml={path to yaml file}
```

Example:

```bash
just deploy cdp-eva-dev-001
```

Or optionally passing cookiecutter yaml
```bash
just deploy cdp-eva-dev-001 cookiecutter-yaml='some/fakepath.yaml'
```

Enable video / audio clipping:

```bash
Expand Down Expand Up @@ -109,4 +122,14 @@ with each collection model.
Useful links for managing Cloud Functions:

* [Pre-installed System Packages](https://cloud.google.com/functions/docs/reference/system-packages)
* [Execution Environments](https://cloud.google.com/functions/docs/concepts/execution-environment)
* [Execution Environments](https://cloud.google.com/functions/docs/concepts/execution-environment)

## Troubleshooting

If you receive a `firebase: not found` error at any point in the deployment process, make sure that you have the Firebase CLI installed.

`Invalid project selection, please verify project cdp-isaac-dev-2023 exists and you have access.`
- Run `firebase projects:list` and check whether your project is listed
- Run `firebase projects:addfirebase {{project-name}}`

If you are running into issues with various packages or tools not being installed, it is highly recommended to start a fresh virtual env.