Code Monkey home page Code Monkey logo

Comments (8)

ckdake avatar ckdake commented on May 28, 2024

The above was on OSX. When running on Ubuntu via multipass on OS X I ran into a handful of other things, this is what I needed to do to get a successful image build locally:

First, install http://multipass.run

multipass launch -d 25G -m 4G -n choochoo
shell to multipass
sudo apt-get update
sudo apt-get install -y npm webpack node-compression-webpack-plugin node-babel-loader python3-venv docker.io docker-compose
sudo usermod -a -G docker ubuntu
logout and log back in
git clone https://github.com/andrewcooke/choochoo.git
cd ~/choochoo/js && npm install babel-loader
cd ~/choochoo/py && python3 -m venv env
cd ~/choochoo/dkr/ && ./make-choochoo-image.sh

It builds! Then back to instructions on https://andrewcooke.github.io/choochoo/

./run-ch2-jp-pg-persist.sh --reset is off to the races

from choochoo.

ckdake avatar ckdake commented on May 28, 2024

And to access in browser, I had to add my ssh key to ~/.ssh/authorized_keys in multipass and forward the port:

ssh -L 8000:127.0.0.1:8000 [email protected]

from choochoo.

andrewcooke-isti avatar andrewcooke-isti commented on May 28, 2024

hi. ok, thanks for all this. i am just starting to look at it. sorry for the delay.

for 1 (scripts must be run from inside dkr folder) what do you recommend? i have this problem a lot with shell scripts that refer to other files and don't have a great solution:

  • if i rewrite so they are run from the home directory then someone who runs them from the dkr directory will have problems.

  • if i hard-code a path then there are problems if someone installs elsewhere. although i guess i could introduce a single variable that identifies the root and have people define that.

  • i've tried searching for bash best practices and haven't found anything useful.

for 4, it seems some python installs have env as a separate package (it's really part of python as far as i can tell). so your package manager may need to install python-env or similar.

you're using ./run-ch2-jp-pg-persist.sh which is the right choice. for development i also use ./run-pg-persist.sh which uses the same data disks but runs python directly (it also switches to the 'dev' disks unless told otherwise). the other scripts should probably be deleted.

from choochoo.

andrewcooke-isti avatar andrewcooke-isti commented on May 28, 2024

ah, for 1 i can probably use something based on https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself

edit: http://mywiki.wooledge.org/BashFAQ/028

from choochoo.

andrewcooke avatar andrewcooke commented on May 28, 2024

ok, (1) is maybe fixed in dev.

now looking at (2). did you do npm install in the js directory? afaict that should have installed webpack.

later today i will try spinning up a socker ubuntu and seeing what i can duplicate.

from choochoo.

andrewcooke avatar andrewcooke commented on May 28, 2024

i installed ubuntu 20 in a virtual machine and tried to get things working. i found an ubuntu-specific bug and various unclear things. i've commited my fixes to the dev branch. right now, this works for me (starting from a clean VM that has gcc, make and perl already installed so that i could install the virtalbox client packages):

git clone https://github.com/andrewcooke/choochoo.git
cd choochoo
git checkout dev --

# set up the python env
sudo apt-get install python3.8-venv libpq-dev python3.8-dev
dev/make-env-py.sh

# set up the javascript env
sudo apt-get install npm
dev/make-env-js.sh

# set up docker
sudo apt-get install apt-transport-https ca-certificates curl \
     gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
     "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
     $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose
sudo usermod -aG docker $USER

[reboot]

cd choochoo
# run just postgres as a first test
dkr/run-pg-persist.sh --reset
[ctrl-c]
# run the whole thing
FORCE_NEW_DISK=1 dkr/run-ch2-jp-pg-persist.sh --reset

visible at http://0.0.0.0:8000/

from choochoo.

andrewcooke avatar andrewcooke commented on May 28, 2024

i made a new release with the changes i added and updated documentation. i'd suggest doing at least a git pull and better a full re-install on ubuntu.

thanks for all the feedback. i hope the fixes work out.

from choochoo.

ckdake avatar ckdake commented on May 28, 2024

Thanks, this is great. I've done a dry run locally and we're in good shape. I'm sending a PR for the docs index here shortly.

from choochoo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.