Skip to content

Commit

Permalink
rename gamora to monsoon
Browse files Browse the repository at this point in the history
  • Loading branch information
reevejd committed Aug 18, 2019
1 parent a962d6a commit 45c8aa4
Show file tree
Hide file tree
Showing 13 changed files with 110 additions and 210 deletions.
6 changes: 1 addition & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#!/usr/bin/env bash

export REGISTRY_HOST="bigdatauniversity/"
export REPO="bigdatauniversity/portals.gamora"

export PIP_REPO_USERNAME=""
export PIP_REPO_PASSWORD=""
export PIP_REPO_HOST_WITH_CREDS="https://${PIP_REPO_USERNAME:?}:${PIP_REPO_PASSWORD:?}@na.artifactory.swg-devops.com/artifactory/api/pypi/apset-pypi-local/simple"
export REPO="backwork"

export BACKUP_LOCAL_PATHS="/etc /var"
export LOCAL_BACKUP_NUMBER=
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased][]

## [1.4.0][] - 2019-08-18

### Changed

- `gamora`/`monsoon` is now `backwork`


## [1.3.0][] - 2019-07-24

### Added
Expand All @@ -24,7 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Added

- Added `monsoon-upload-cos` plugin to upload backup files to IBM Cloud Object Storage
- Added `backwork-upload-cos` plugin to upload backup files to IBM Cloud Object Storage

## [1.0.1][] - 2018-04-06

Expand Down
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Contributing

## Development

1. Build locally.

```sh
bin/build
```

2. Run locally.

```sh
cp .env{.example,}
nano .env
docker-compose up
```

## Publishing

1. Build and publish.

```sh
git add ...
git commit
git tag -a 0.1.0 -m v0.1.1 # If you want to publish
git push --tags
```

2. Check dockerhub

## License

Please refer to [LICENSE](LICENSE).

## Authors

* IBM Developer Skills Network
41 changes: 2 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,5 @@
[![Build Status](https://travis.ibm.com/bdu/gamora.svg?token=sEYcW68KU3tGRyi3z1eH&branch=master)](https://travis.ibm.com/bdu/gamora)
# Backwork

# Gamora

Automated backups for MySQL, Mongo, and file paths using the Monsoon library.
Automated backups for MySQL, Mongo, and file paths using the Backwork library.

## Development

1. Build locally.

```sh
bin/build
```

2. Run locally.

```sh
cp .env{.example,}
nano .env
docker-compose up
```

## Production

1. Build and publish.

```sh
git add ...
git commit
git tag -a 0.1.0 -m v0.1.1 # If you want to publish
git push --tags
```

2. Check [Travis](https://travis.ibm.com/bdu/gamora/builds).

## License

Please refer to [LICENSE](LICENSE).

## Authors

* Partner Ecosystem Team, IBM Digital Business Group <mailto:[email protected]>
File renamed without changes.
40 changes: 40 additions & 0 deletions backwork/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM python:3.7.4-alpine3.9
LABEL maintainer="[email protected]"

# Install database clients
# Apply security patches
# hadolint ignore=DL3018
RUN echo 'http://dl-3.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories \
&& echo 'http://dl-3.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories \
&& apk add --no-cache \
bash \
curl \
libressl \
mariadb-client \
mongodb-tools \
mysql \
postgresql \
tini \
&& apk add --upgrade --no-cache \
db \
expat \
freetype \
fontconfig \
libpng \
ncurses \
zlib

RUN curl -sL https://sentry.io/get-cli/ | bash

##########
# Backwork
##########

COPY requirements.txt ./
RUN pip install -r ./requirements.txt

COPY ./docker-entrypoint.sh /

VOLUME ["/backups"]
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/docker-entrypoint.sh"]
12 changes: 6 additions & 6 deletions gamora/docker-entrypoint.sh → backwork/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ upload_backup() {
remote_path="${SOFTLAYER_PATH:?}/$(date +%Y/%m)"

log "Uploading backup"
monsoon "${NOTIFICATION_SETTINGS[@]}" upload softlayer \
backwork "${NOTIFICATION_SETTINGS[@]}" upload softlayer \
--username "${SOFTLAYER_USER:?}" \
--api-key "${SOFTLAYER_API_KEY:?}" \
--datacenter "${SOFTLAYER_DATACENTER:?}" \
Expand Down Expand Up @@ -87,7 +87,7 @@ upload_backup_cos() {
fi

log "Uploading backup to IBM COS"
monsoon "${NOTIFICATION_SETTINGS[@]}" upload cos \
backwork "${NOTIFICATION_SETTINGS[@]}" upload cos \
--endpoint-url "${IBM_COS_ENDPOINT_URL}" \
--instance-id "${IBM_COS_INSTANCE_ID}" \
--access-key "${IBM_COS_ACCESS_KEY}" \
Expand Down Expand Up @@ -118,7 +118,7 @@ back_up_mongo() {
filename=mongo_backup_$(date +"%Y%m%d_%H%M%S").archive.gz

log "Taking mongo backup"
monsoon "${NOTIFICATION_SETTINGS[@]}" backup mongo \
backwork "${NOTIFICATION_SETTINGS[@]}" backup mongo \
-u "${MONGO_BACKUP_USER}" \
-p "${MONGO_BACKUP_PASSWORD}" \
--host="${MONGO_HOST}" \
Expand All @@ -140,7 +140,7 @@ back_up_mysql() {
filename=mysql_backup_$(date +"%Y%m%d_%H%M%S").archive.gz

log "Taking mysql backup"
monsoon "${NOTIFICATION_SETTINGS[@]}" backup mysql \
backwork "${NOTIFICATION_SETTINGS[@]}" backup mysql \
--output="${BACKUP_PATH:?}/${filename}" \
--gzip \
--all-databases \
Expand Down Expand Up @@ -176,7 +176,7 @@ back_up_postgresql() {

filename=postgresql_backup_${database:?}_$(date +"%Y%m%d_%H%M%S").archive.gz

monsoon "${NOTIFICATION_SETTINGS[@]}" backup postgresql \
backwork "${NOTIFICATION_SETTINGS[@]}" backup postgresql \
--output="${BACKUP_PATH:?}/${filename}" \
--gzip \
"--host=${PGHOST:?}" \
Expand All @@ -202,7 +202,7 @@ back_up_files() {

log "Taking file backup"
# shellcheck disable=SC2086
cmd="monsoon ${NOTIFICATION_SETTINGS[@]} backup files \
cmd="backwork ${NOTIFICATION_SETTINGS[@]} backup files \
--output=\"${BACKUP_PATH:?}/${filename}\""
for f in ${BACKUP_LOCAL_PATHS_EXCLUDE:-}; do
cmd="${cmd} --exclude=\"${f}\""
Expand Down
10 changes: 10 additions & 0 deletions backwork/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
contextlib2==0.5.4
httplib2==0.9.2
backwork==0.3.0
backwork-backup-files==0.3.0
backwork-backup-mongo==0.3.0
backwork-backup-mysql==0.3.0
backwork-backup-postgresql==0.2.1
backwork-notifier-sentry==0.2.0
backwork-upload-softlayer==0.2.1
backwork-upload-cos==0.3.0
12 changes: 0 additions & 12 deletions bin/build

This file was deleted.

20 changes: 0 additions & 20 deletions bin/push

This file was deleted.

23 changes: 5 additions & 18 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ version: "2"

services:
#
# Gamora
# Backwork
#
gamora:
backwork:
build:
context: ./gamora
args:
- PIP_REPO_HOST_WITH_CREDS
- PIP_REPO_USERNAME
- PIP_REPO_PASSWORD
image: bigdatauniversity/portal.gamora:$TAG
context: ./backwork
image: bigdatauniversity/portal.gamora:dev
environment:
- MYSQL_HOST=mysql
- MYSQL_PORT=3306
Expand Down Expand Up @@ -44,16 +40,6 @@ services:
- mysql
- mongo

latest:
build:
context: ./gamora
args:
- PIP_REPO_HOST_WITH_CREDS
- PIP_REPO_USERNAME
- PIP_REPO_PASSWORD
image: bigdatauniversity/portal.gamora:latest
command: "bash -c 'sleep 3600'"

##
# MySQL
##
Expand All @@ -67,6 +53,7 @@ services:

##
# Mongo
# TODO: replace with a public image
##
mongo:
image: ${REGISTRY_HOST}portal.mongo:0.2.0-e.2
Expand Down
Loading

0 comments on commit 45c8aa4

Please sign in to comment.