Skip to content
Permalink
Browse files

Remove specific references to PA instance from infrastructure config (

…#131)

* Remove references to DistrictBuilder PA from infrastructure

In bringing over some infrastructure updates from the PA instance
of DistrictBuilder, we introduced a few references to variables in
the PA instance infrastructure. Either make these generic, or revert
them to refer to Virginia where appropriate.

* Remove CloudFormation template

Now that the deployment infrastructure is fully migrated to
Terraform, there's no reason to keep a CloudFormation template
file in this repository.
  • Loading branch information...
jeancochrane authored and rbreslow committed Dec 7, 2018
1 parent ef556c3 commit 9cf774ba1ef72715c878d5183280caea27bc5617
@@ -23,7 +23,7 @@ MAILER_PASSWORD=
MAILER_USE_TLS_OR_SSL=tls
ROLLBAR_SERVER_TOKEN=
ROLLBAR_CLIENT_TOKEN=
AWS_XRAY_TRACING_NAME=district-builder-dtl-pa
AWS_XRAY_TRACING_NAME=district-builder
AWS_XRAY_DAEMON_ADDRESS=xray.districtbuilder.internal:2000
AWS_XRAY_CONTEXT_MISSING=LOG_ERROR
AWS_REGION=us-east-1
@@ -11,6 +11,7 @@ sld
geoserver/data_dir
data
config_settings.py

*-backup.xsd

# Terraform
@@ -21,4 +22,4 @@ deployment/terraform/.terraform
*.retry

# User data
deployment/user-data
deployment/user-data
@@ -18,13 +18,13 @@ install:
- sed -i 's/MAP_SERVER_ADMIN_PASSWORD=/MAP_SERVER_ADMIN_PASSWORD=geoserver/' .env
- cp django/publicmapping/config/config.dist.xml django/publicmapping/config/config.xml
- "./scripts/update"
- wget -qO ./data/districtbuilder_data.zip http://s3.amazonaws.com/global-districtbuilder-data-us-east-1/pa/pa_3785_census.zip
- wget -qO ./data/districtbuilder_data.zip https://s3.amazonaws.com/districtbuilderdata/VA_data.zip
script:
- "./scripts/test"
before_deploy:
- mkdir -p ~/.ssh
- openssl aes-256-cbc -K $encrypted_c49e2c465c08_key -iv $encrypted_c49e2c465c08_iv
-in district-builder-pa.pem.enc -out ~/.ssh/district-builder-pa.pem -d
-in district-builder.pem.enc -out ~/.ssh/district-builder.pem -d
- cp django/publicmapping/config/config.xml deployment/user-data/config.xml
- mv ./data/districtbuilder_data.zip deployment/user-data/
deploy:
@@ -42,4 +42,4 @@ deploy:
branch: develop
after_deploy:
- docker-compose -f docker-compose.ci.yml run --rm --entrypoint git terraform clean -fdx
- rm -f ~/.ssh/district-builder-pa.pem
- rm -f ~/.ssh/district-builder.pem
@@ -1,6 +1,6 @@
# DistrictBuilder

[![Build Status](https://travis-ci.org/azavea/district-builder-dtl-pa.svg?branch=develop)](https://travis-ci.org/azavea/district-builder-dtl-pa)
[![Build Status](https://travis-ci.org/PublicMapping/DistrictBuilder.svg?branch=develop)](https://travis-ci.org/PublicMapping/DistrictBuilder)

[DistrictBuilder](http://www.districtbuilder.org/) is software created by the [Public Mapping Project](http://www.publicmapping.org/resources/software).

@@ -38,9 +38,9 @@ $ vagrant ssh
$ ./scripts/update
```

If you want to get DistrictBuilder up and running quickly with PA data, you can then run
If you want to get DistrictBuilder up and running quickly with demo data, you can then run
```bash
$ ./scripts/configure_pa_data
$ ./scripts/configure_va_data
```

Otherwise, you'll need to provide your own shapefiles and config.xml file. Put your zipped shapefile in
@@ -80,13 +80,13 @@ From there, running `./scripts/update` builds containers. The rest of the setup
directly or indirectly through a setup management command. To get started, run
`./scripts/setup`, followed by `vagrant ssh`, followed by `./scripts/update`.

Then, run `./scripts/configure_pa_data`. It is not fast. Currently, it takes several hours, with the exact
Then, run `./scripts/configure_va_data`. It is not fast. Currently, it takes several hours, with the exact
time depending on hardware. We are working on ways to improve the speed of loading data.

The script will do several things

- Fetch zipped shapefile data for Pennsylvania into a specific location
- Drop and recreate the `district_builder**
- Fetch zipped shapefile data for Virginia into a specific location
- Drop and recreate the `district_builder` database
- Run database migrations: create the relationships that data will be loaded into
- Load shapes from shapefiles at different levels: create records for the shapes and characteristics
in the configured shapefiles

This file was deleted.

Oops, something went wrong.
@@ -23,7 +23,7 @@ Amazon Web Services deployment is driven by [Terraform](https://terraform.io/),

#### SSH Keys

You'll need to download the `district-builder-pa` SSH Keypair from the fileshare, and store it at `~/.ssh/district-builder-pa.pem`.
- You'll need to generate an SSH Keypair using the AWS EC2 console. Download the private key, and store it at `~/.ssh/district-builder.pem`.

#### `DB_SETTINGS_BUCKET`

@@ -36,16 +36,16 @@ You will upload your own DistrictBuilder `config.xml` and shapefile zip to the A
#### `scripts/infra`
Once the settings bucket and User Data are configured, you can run the deployment. To deploy the infrastructure for a DistrictBuilder instance (EC2, Route53 records, etc.) resources, use the `infra` wrapper script to lookup the remote state of the infrastructure and assemble a plan for work to be done. You can run `scripts/infra` inside of the `terraform` Docker container defined in `docker-compose.ci.yml`, which contains all of the necessary software dependencies for deployments.

First, obtain your account's AWS API keypair, and configure your `district-builder-pa` AWS profile. Then, set `DB_SETTINGS_BUCKET` and `IMAGE_VERSION`, and run `scripts/infra`:
First, obtain your account's AWS API keypair, and configure your `district-builder` AWS profile. Then, set `DB_SETTINGS_BUCKET` and `IMAGE_VERSION`, and run `scripts/infra`:


```bash
$ aws --profile district-builder-pa configure
$ aws --profile district-builder configure
AWS Access Key ID [None]: ****************BWCA
AWS Secret Access Key [None]: ****************hlS4
Default region name [None]: us-east-1
Default output format [None]:
$ export AWS_PROFILE=district-builder-pa
$ export AWS_PROFILE=district-builder
$ export DB_SETTINGS_BUCKET="district-builder-dtl-staging-config-us-east-1"
# IMAGE_VERSION can be a git SHA, or version tag
$ export IMAGE_VERSION=123456"
@@ -85,11 +85,11 @@ $ ./scripts/load_configured_data --production
Depending on the configuration changes, staging will sometimes get into a bad state after deployment as we do not handle all types of config changes perfectly. As a result, you may need to "wipe the slate clean" in staging to see your changes. You can do this by ssh-ing into the staging app server, downloading the appropriate script, and running it, like so (**NOTE: the database will be dropped and recreated!**):
```bash
$ ssh-add ~/.ssh/district-builder-pa.pem
$ ssh-add ~/.ssh/district-builder.pem
...
$ ssh -A ec2-user@bastion.staging.pa.districtbuilder.azavea.com
$ ssh -A ec2-user@bastion.staging.<state>.districtbuilder.azavea.com
...
$ ssh ec2-user@pa.districtbuilder.internal
$ ssh ec2-user@$<state>.districtbuilder.internal
...
$ docker exec -ti districtbuilder-django bash
...
@@ -29,7 +29,7 @@ variable "remote_state_bucket_prefix" {
variable "is_subdomain" {}

variable "ssh_identity_file_path" {
default = "~/.ssh/district-builder-pa.pem"
default = "~/.ssh/district-builder.pem"
}

variable "cloudfront_aliases" {
Binary file not shown.
Binary file not shown.
@@ -98,10 +98,6 @@
}
MIDDLEWARE.append('rollbar.contrib.django.middleware.RollbarNotifierMiddleware')

SERIALIZATION_MODULES = {
"geojson": "django.contrib.gis.serializers.geojson",
}

ROOT_URLCONF = 'publicmapping.urls'

TEMPLATES = [
@@ -4,6 +4,6 @@ services:
environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_PROFILE=${AWS_PROFILE:-district-builder-pa}
- AWS_PROFILE=${AWS_PROFILE:-district-builder}
volumes:
- ~/.aws:/root/.aws
@@ -14,7 +14,7 @@ services:
- IMAGE_VERSION=${IMAGE_VERSION:-latest}
- DB_STATE=${DB_STATE:-va}
- DB_SETTINGS_BUCKET=${DB_SETTINGS_BUCKET:-districtbuilder-staging-config-us-east-1}
- DB_DOCKER_HOST=${DB_DOCKER_HOST:-origin.staging.pa.districtbuilder.azavea.com:2476}
- DB_DOCKER_HOST=${DB_DOCKER_HOST:-origin.staging.va.districtbuilder.azavea.com:2476}
volumes:
- ./:/usr/local/src
- ~/.ssh:/root/.ssh
@@ -59,7 +59,6 @@ services:
volumes:
- reports:/opt/reports
- tmp:/tmp
- translations:/usr/src/app/locale
entrypoint: /usr/local/bin/celery
command:
- "worker"

0 comments on commit 9cf774b

Please sign in to comment.
You can’t perform that action at this time.