Skip to content

Commit

Permalink
Update and cleanup infrastructure components
Browse files Browse the repository at this point in the history
  • Loading branch information
pantierra authored and Felix D committed Apr 22, 2020
1 parent 3b4b933 commit c1cdec0
Show file tree
Hide file tree
Showing 25 changed files with 23 additions and 119 deletions.
14 changes: 8 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ jobs:
build:
working_directory: /home/circleci/app
docker:
- image: circleci/python:3.7-stretch-browsers
- image: circleci/python:3-buster-browsers
steps:
- checkout
- setup_remote_docker
- run:
name: Install Node and modules
command: |
sudo apt-get update
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
sudo apt-get install -y nodejs libgeos-dev # Required for shapely
sudo apt-get install -y nodejs npm libgeos-dev # Required for shapely
sudo npm install -g @mapbox/cfn-config @mapbox/cloudfriend
sudo pip3 install awscli --upgrade
- run:
Expand Down Expand Up @@ -130,7 +129,11 @@ jobs:
type: env_var_name
working_directory: /home/circleci/tasking-manager
docker:
<<<<<<< HEAD
- image: circleci/python:3.7-stretch
=======
- image: circleci/python:3-buster
>>>>>>> Update and cleanup infrastructure components
steps:
- checkout
- setup_remote_docker
Expand All @@ -142,8 +145,7 @@ jobs:
name: Install Node and modules
command: |
sudo apt-get update
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
sudo apt-get install -y nodejs libgeos-dev # Required for shapely
sudo apt-get install -y nodejs npm libgeos-dev # Required for shapely
sudo npm install -g @mapbox/cfn-config @mapbox/cloudfriend
npm install
sudo pip3 install awscli --upgrade
Expand Down Expand Up @@ -206,7 +208,7 @@ jobs:
echo $JSON_CONFIG > $CIRCLE_WORKING_DIRECTORY/cfn-config-<< parameters.stack_name >>.json
- deploy:
name: Deploy to << parameters.stack_name >>
command: cfn-config update << parameters.stack_name >> $CIRCLE_WORKING_DIRECTORY/devops/cloudformation/tasking-manager.template.js -f -c hot-cfn-config -t hot-cfn-config -r $AWS_REGION -p "$JSON_CONFIG"
command: cfn-config update << parameters.stack_name >> $CIRCLE_WORKING_DIRECTORY/scripts/aws/cloudformation/tasking-manager.template.js -f -c hot-cfn-config -t hot-cfn-config -r $AWS_REGION -p "$JSON_CONFIG"
- run:
name: Cleanup
when: always
Expand Down
65 changes: 0 additions & 65 deletions devops/install/install_on_debian_9_stretch.sh

This file was deleted.

4 changes: 2 additions & 2 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ services:

# Main application
app:
build: ./devops/docker/tasking-manager
build: ./scripts/docker/tasking-manager
volumes:
- .:/usr/src/app
ports:
- "3000:3000"

# Migration service
migration:
build: ./devops/docker/tasking-manager
build: ./scripts/docker/tasking-manager
volumes:
- .:/usr/src/app
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:

# Database
postgresql:
image: mdillon/postgis:9.6
image: mdillon/postgis:11
container_name: postgresql
env_file: tasking-manager.env
# logging:
Expand Down
4 changes: 2 additions & 2 deletions docs/migration-from-tm2.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Ensure everything is met to start the migration: For this lunch the new Tasking

## Database Migration

With the empty database for new Tasking Manager created, we can now migrate all the data from the TM2 installation. A [database migration script is included](../devops/database/migration-from-tm2-postgres.sql) to assist in this process. The beginning of this file contains important information regarding the assumptions of your prior database name and permissions, so please read it. That text will walk you through backing up your old TM2 database and creating a new temporary database for your TM2 data--though not required, it is recommended.
With the empty database for new Tasking Manager created, we can now migrate all the data from the TM2 installation. A [database migration script is included](../scripts/database/migration-from-tm2-postgres.sql) to assist in this process. The beginning of this file contains important information regarding the assumptions of your prior database name and permissions, so please read it. That text will walk you through backing up your old TM2 database and creating a new temporary database for your TM2 data--though not required, it is recommended.

The database migration script is available at https://github.com/hotosm/tasking-manager/blob/master/devops/database/migration-from-tm2-postgres.sql
The database migration script is available at https://github.com/hotosm/tasking-manager/blob/master/scripts/database/migration-from-tm2-postgres.sql

## After Migration

Expand Down
9 changes: 3 additions & 6 deletions docs/setup-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The backend server is made up of a postgres database and an associated API that
* [pip](https://pip.pypa.io/en/stable/installing/)
* [libgeos-dev](https://trac.osgeo.org/geos/)

You can check the [Dockerfile](../devops/docker/tasking-manager/Dockerfile) to have a reference of how to install it in a Debian/Ubuntu system.
You can check the [Dockerfile](../scripts/docker/tasking-manager/Dockerfile) to have a reference of how to install it in a Debian/Ubuntu system.

#### Configuration

Expand All @@ -86,9 +86,6 @@ You can check the [Dockerfile](../devops/docker/tasking-manager/Dockerfile) to h
* Linux/Mac:
* ```. ./venv/bin/activate```
* ```pip install -r requirements.txt```
* Windows (use installer because of precompiled libs):
* ```.\venv\scripts\activate```
* ```.\devops\win\install.bat```

#### Tests

Expand Down Expand Up @@ -117,7 +114,7 @@ python3 manage.py db upgrade

#### Migrating your data from TM2

You can use [this script](../devops/tm2-pg-migration/migrationscripts.sql) to migrate your data from the prior tasking manager version (v2) to the current one. Please see [this documentation page](./migration-tm2-to-tm3.md) for important information about this process.
You can use [this script](../scripts/tm2-pg-migration/migrationscripts.sql) to migrate your data from the prior tasking manager version (v2) to the current one. Please see [this documentation page](./migration-tm2-to-tm3.md) for important information about this process.

#### Set permissions to create a task

Expand Down Expand Up @@ -181,7 +178,7 @@ Following must be available locally:
1. From the root of the project:

`
docker build -t tasking-manager-db ./devops/docker/postgis
docker build -t tasking-manager-db ./scripts/docker/postgis
`

2. The image should be downloaded and build locally. Once complete you should see it listed, with
Expand Down
25 changes: 0 additions & 25 deletions package.json

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ const Resources = {
'sudo apt-get -y install python3.6-dev',
'sudo apt-get -y install python3.6-venv',
'sudo apt-get -y install curl',
'curl -sL https://deb.nodesource.com/setup_6.x > install-node6.sh',
'sudo chmod +x install-node6.sh',
'sudo ./install-node6.sh',
'curl -o install-node10.sh -sL https://deb.nodesource.com/setup_10.x',
'sudo chmod +x install-node10.sh',
'sudo ./install-node10.sh',
'sudo apt-get -y install nodejs',
'sudo npm install gulp -g',
'npm i browser-sync --save',
Expand Down
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.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3-stretch
FROM python:3-buster

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
Expand All @@ -24,8 +24,7 @@ RUN pip install --no-cache-dir -r requirements.txt
## CLIENT CONFIGURATION

# Install nodejs.
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash - \
&& apt-get install -y nodejs
RUN apt-get install -y nodejs npm

RUN npm install -g gulp-cli karma karma-jasmine karma-chrome-launcher

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ sudo apt install -y python3 python3-dev python3-venv &&
sudo apt install -y postgresql-10 libpq-dev postgresql-server-dev-10 postgresql-10-postgis-2.4 postgresql-10-postgis-scripts &&

# Install Node
curl -sL https://deb.nodesource.com/setup_10.x > install-node.sh &&
sudo chmod +x install-node.sh && sudo ./install-node.sh &&
sudo apt -y install nodejs &&
sudo apt -y install nodejs npm &&
sudo npm install -g gulp gulp-cli karma karma-jasmine karma-chrome-launcher &&

## Obtain the tasking manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ sudo apt install -y python3 python3-dev python3-venv &&
sudo apt install -y postgresql-10 libpq-dev postgresql-server-dev-10 postgresql-10-postgis-2.4 postgresql-10-postgis-scripts &&

# Install Node
curl -sL https://deb.nodesource.com/setup_10.x > install-node.sh &&
sudo chmod +x install-node.sh && sudo ./install-node.sh &&
sudo apt -y install nodejs &&
sudo apt -y install nodejs npm &&
sudo npm install -g gulp gulp-cli karma karma-jasmine karma-chrome-launcher &&

## Obtain the tasking manager
Expand Down

0 comments on commit c1cdec0

Please sign in to comment.