Skip to content
This repository has been archived by the owner on Aug 28, 2020. It is now read-only.

Write Vagrant bootstrap.sh for CLTK and CLTK API #32

Open
kylepjohnson opened this issue Mar 29, 2016 · 11 comments
Open

Write Vagrant bootstrap.sh for CLTK and CLTK API #32

kylepjohnson opened this issue Mar 29, 2016 · 11 comments
Assignees

Comments

@kylepjohnson
Copy link
Member

Building upon Manvendra's script to automate Nginx: https://gist.github.com/manu-chroma/4a6f3b6b27aa49683c67b9fb0b23d493

Let's add the basic setup, too:

Relevant Vagrant example here: https://www.vagrantup.com/docs/getting-started/provisioning.html

Please reach out for anything you get stuck on, we're here to help.

@manu-chroma
Copy link
Contributor

@kylepjohnson Do you want a vagrant setup script specifically or a general bash script ?

@kylepjohnson
Copy link
Member Author

Vagrant uses plain Bash scripts anyway, so what you do will work with and without Vagrant. Though I recommend using Vagrant from the start. Also we'll want this to be accompanied with a Vagrantfile in the file version.

@manu-chroma
Copy link
Contributor

Got it! 👍

@manu-chroma
Copy link
Contributor

@kylepjohnson I've divided the bootstrap script into multiple small scripts, each of which would serve the features you've mentioned in the issue.
I was wondering where should I put all these scripts and the vagrantfile ?
Should I create a new repo for vagrant and associated bootstrap scripts ?

P.S I'm still working on them. Not completed yet.

@ferthalangur
Copy link

Does the cltk user need sudo privilege in order to function as the application's home / run directory?

@ferthalangur
Copy link

manu-chroma commented 8 days ago
@kylepjohnson I've divided the bootstrap script into multiple small scripts, each of which would serve the features you've mentioned in the issue.
I was wondering where should I put all these scripts and the vagrantfile ?
Should I create a new repo for vagrant and associated bootstrap scripts ?

My recommendation (for discussion): create a new repository called cltk_server_builds (or something similar if you have a naming schema) where everything needed to build a specific type of server will be aggregated into a folder by the name of the type of server/service first, then the method of building (e.g., docker, vagrant, ...) and then the third level the actual stuff for the build. If there are generic components that will be used for multiple builds, they can go in a "shared" folder at the server/service level. Caveat -- I need to make a test to see whether Vagrant is allowed to look outside of it's home directory for resources, or to follow symlinks. If not, the shared concept must die. Otherwise, if there are components that will be common to multiple server builds then it makes sense to share them instead of make multiple copies.

Example:

/cltk_api-server/
                         docker-build/
                                             TBD.md

                         vagrant-build/
                                               scripts/
                                                          nginx_config.bash
                                                          some-other-script.bash
                                                VagrantFile

cltk_reader-server/
                              TBD.md                                         

shared/
            scripts/
                       cltk_user.bash

@manu-chroma
Copy link
Contributor

Does the cltk user need sudo privilege in order to function as the application's home / run directory?

@ferthalangur sudo will be required in some places. For example, to install necessary packages from apt-get such as nginx
Apart from that, to create a config file for nginx, we'll need to have sudo privilages. The file is present in /etc/nginx/ directory.
It is assumed that the complete server setup will be done by the cltk user through series of bash scripts.

I really like the idea of having all types of server build files in one place. @kylepjohnson You can create a new repository, I'll send a PR creating the basic folder structure and adding necessary files ?

@kylepjohnson
Copy link
Member Author

Hi Guys, I'm obviously still catching up.

@manu-chroma Here's a repo for Vagrant: https://github.com/cltk/cltk_vagrant. Do whatever you want with it!

As for the sudo issues, how about we make two users? One with sudo for installation and another (say, cltk) just for running code (core, api, and frontend). Thus we'd have runtime security. @ferthalangur would that work?

@ferthalangur
Copy link

@kylepjohnson @manu-chroma ... Yes, that would work very well. On the production machines that we set up, we usually have a user called administrator that has sudo powers for installation, modifications, monitoring, etc. That would be the account vagrant uses to build the applications and create the cltk user.

@kylepjohnson
Copy link
Member Author

Thanks, Rob! Let's plan on using an admin and cltk users as above.

@manu-chroma
Copy link
Contributor

@kylepjohnson @ferthalangur
I'll modify the scripts accordingly! 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants