Skip to content

Commit

Permalink
Merge branch 'release/1.0.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
GPelayo committed Feb 16, 2018
2 parents b78d17f + 9117b58 commit 98051f9
Show file tree
Hide file tree
Showing 6 changed files with 989 additions and 3 deletions.
4 changes: 4 additions & 0 deletions redwood/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,7 @@ $ download <objectid> .
```

If that's as expected, things are looking good.

### Admin Tools

Please see [Readme.md](cli/admin/Readme.md) for a more detailed overview of Admin Tools.
3 changes: 0 additions & 3 deletions redwood/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# admin
Redwood CLI

## Overview
Parent tool for administrating redwood. You'll probably want to add _bin/redwood_ to your PATH.

Expand Down
30 changes: 30 additions & 0 deletions redwood/cli/admin/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Admin Tools
Admin Tools for managing Redwood

### Prerequisites
In order to the use the admin tools. You must have access to the root account of this machine.

Then, make sure your machine has the following installed:

-Python 2.7+
-VirtualEnv
-Pip

Finally, do the following steps to create the python virtual environment.

1. Use VirtualEnv create a python virtual environment in the admin folder. (<dcc-ops dir>/redwood/cli/admin)
2. Activate the virtual environment
3. Use Pip and requirements.txt to install the python packages

### Setup
Before doing any admin tasks, first do the following,

1. Login as root
2. Active the virutual environment (if it's not already activated)

### Delete
For File Deletion, all you need to do is run delete.py in <dcc-ops dir>/redwood/cli/admin with the file uuid.

Example: `python delete.py 10101010-1212-2323-3434-454545454545`

For more detailed overview of the commands, use `python delete -h`
35 changes: 35 additions & 0 deletions redwood/cli/admin/defaults.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""
The default constants of used by admin scripts.
"""

import os


def get_parent_directory(url, level=1):
return "/".join(url.split('/')[:-level])


DCCOPS_DEFAULT_LOCATION = get_parent_directory(os.path.abspath(__file__),
level=4)
DCCOPS_ENV_NAME_ACCESS_ID = 'access_key'
DCCOPS_ENV_NAME_SECRET_KEY = 'secret_key'
DCCOPS_ENV_NAME_REDWOOD_ENDPOINT = 'base_url'
DCCOPS_ENV_NAME_REDWOOD_BUCKET = 's3_bucket'
DCCOPS_ENV_FILENAME = '.env'
DCCOPS_BOARDWALK_SUB_DIR = 'boardwalk'
DCCOPS_ACTION_SERVICE_SUB_DIR = 'action'
DCCOPS_REDWOOD_SUB_DIR = 'redwood'

METADATA_FILE_ROOT_FOLDER = 'data'

DELETED_LIST_FILENAME = 'deleted_file_list'

MONGODB_CONTAINER = 'redwood-metadata-db'
DEFAULT_MONGODB_HOST = '127.0.0.1:27017'
DEFAULT_MONGODB_DB_NAME = 'dcc-metadata'
MONGODB_URL = "{}/{}".format(DEFAULT_MONGODB_HOST,
DEFAULT_MONGODB_DB_NAME)

INDEXER_CONTAINER = 'boardwalk_dcc-metadata-indexer_1'

BUNDLE_METADATA_FILENAME = 'metadata.json'
Loading

0 comments on commit 98051f9

Please sign in to comment.