Skip to content

Commit

Permalink
Merged in dev/gideon/updates_2020.09.30 (pull request elastic#9)
Browse files Browse the repository at this point in the history
Enhance fab create-sanbox

create-sandbox will now also create an ant-media app for the sandbox and create
directories for the various Engageli components.

Update README

Approved-by: Alan Nuchnoi
  • Loading branch information
Gideon Avida committed Oct 1, 2020
1 parent b05968f commit 1656e8a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Expand Up @@ -25,3 +25,26 @@ fab -H <hostname> add-user -u <user name> -p <path to user's SSH public key>
```
fab -H <hostname> create-sandbox -u <user name> [-p <user's port number>]
```
This also create an ant-media webapp and creates the following dirs:
* backend1: `/usr/local/engageli/<name>`
* media-manager backend: `/usr/local/media-manager/<name>`
* media-manager webapp: `/usr/local/media-manager-static/<name>-mm`
* student webapp: `/usr/local/antmedia/webapps/<name>/student`

## Building a new instance

1. To simplify life, create a user using the `fab` command above.
1. Run `backend1/server-setup.sh` on the instance to install node, nginx,
postgres and redis (assuming all in one instance)
1. Install Ant Media Server (`devops/ant-cluster/setup-ant-media.sh`)
https://github.com/ant-media/Ant-Media-Server/wiki/Installation
1. Copy `nginx/engageli-site` to `/etc/nginx/sites-available/` on the instance and configure SSL
1. Create user's sandbox infrastructure by running the `fab` command above.
1. Install `backend1` by running
`backend1/utils/sync_to_host.sh -H <instance address> -i -g`. You might need
to add `-n <remote user name>` if it's different than the local user.
1. Install `media-manager` backend:
* Install `ffmpeg` and `ghostscript`
* Run `media-manager/fm/utils/sync_to_host.sh ...`
* Add s3 config to local.yml and restart media manager and file processor services
1. rsync student and media manager webapps to their locations.
12 changes: 12 additions & 0 deletions fabfile.py
Expand Up @@ -109,3 +109,15 @@ def create_sandbox(c, user_name, port=None):
c.run("sudo mv %s /etc/engageli/nginx-locations/" % location_name)
c.run("sudo nginx -t")
c.run("sudo nginx -s reload")
# Create ant media webapp
c.run("sudo /usr/local/antmedia/create_app.sh %s /usr/local/antmedia" % user_name)
# Create directories for backend1, media-manager and webapps
dirs = [
"/usr/local/engageli/%s",
"/usr/local/media-manager/%s",
"/usr/local/media-manager-static/%s-mm",
"/usr/local/antmedia/webapps/%s/student",
]
for d in dirs:
c.run("sudo mkdir -p %s" % (d % user_name))
c.run("sudo chown %s %s" % (user_name, d % user_name))

0 comments on commit 1656e8a

Please sign in to comment.