Skip to content

Commit

Permalink
Change README to favor running in Docker
Browse files Browse the repository at this point in the history
The tooling is old and it is just easier to run in Docker at the moment.
  • Loading branch information
kjetiljd authored Nov 8, 2020
1 parent ee14293 commit 63f8021
Showing 1 changed file with 61 additions and 48 deletions.
109 changes: 61 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,66 +6,38 @@ NB don't show the players the code for this project until after the workshop as

Getting started
---------------
* Install Ruby 1.9.3 and rubygems
* (For Windows)
* Install [Ruby DevKit](http://rubyinstaller.org/downloads/)
* Extract to (e.g.) c:\devkit
* cd c:\devkit
* ruby dk.rb init
* Edit the file config.yml (Add the locations where ruby is installed e.g. c:\Ruby193)
* ruby dk.rb install
* (For Ubuntu 12.04 onwards)
* Remove existing installation of Ruby and ruby related packages (do not use sudo or Ubuntu Software centre or any other Ubuntu package manager to install Ruby or any of its components)
* Remove rvm and related package from Ubuntu
* Install RVM using the instructions on https://rvm.io/
* In case RVM is broken it can be fixed by going to http://stackoverflow.com/questions/9056008/installed-ruby-1-9-3-with-rvm-but-command-line-doesnt-show-ruby-v/9056395#9056395
* Install Ruby and Rubygems using RVM only (for Rubygems use: 'rvm rubygems current' or 'rvm rubygems latest')
* See [Installing Nokogiri](http://nokogiri.org/tutorials/installing_nokogiri.html) for installing requirement
* sudo apt-get install libxslt-dev libxml2-dev
* (For Mac (Xcode 5.1 onwards))
* In the install instructions below you may need to supply an additional argument to ensure that Xcode does not treat an incorrect command line argument as a fatal error when installing Nokogiri.
* The argument is: `ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future` and can be prepended to the install commands.
* Read more here: https://developer.apple.com/library/ios/releasenotes/DeveloperTools/RN-Xcode/Introduction/Introduction.html
The simplest way to get Extreme Startup running is to run in Docker.

* Install dependencies:

````
cd ../<extreme startup dir>
gem install bundler
bundle install
````

* Start the game server

````
bundle exec ruby web_server.rb
````

* Or the docker way

````
```shell script
# The first time
docker build -t extreme_startup .
docker run -p 3000:3000 extreme_startup
````
docker build -t extreme_startup . # ./build.sh
docker run -d -p 80:3000 extreme_startup # ./run.sh
```
and for warmup round
````
docker run -p 3000:3000 -e WARMUP=1 extreme_startup
````
```shell script
docker run -d -p 80:3000 -e WARMUP=1 extreme_startup # ./warmup.sh
```

You can even run the tests in Docker if you are making changes to the code
```shell script
docker run --rm -it --entrypoint=rake extreme_startup # ./test.sh
```

For more information on How to manage docker read [Docker docs](https://docs.docker.com/get-started/overview/)

For more information on How to manage docker read [Docker user guide](https://docs.docker.com/userguide/)
See bottom for how to run this native (the hard way/the Rubyist way).

Notes for facilitators
----------------------

* Run the server on your machine. It's a Sinatra app that by default runs on port 3000.
* Run the server on your machine. It's a Sinatra app that by default runs on port 3000 (the docker scripts typically map to port 80).
* Everyone needs a computer connected to the same network, so that they can communicate. Check that everyone can see the leaderboard page served by the webapp running on your machine. Depending on the situation, we have used a local/ad-hoc network and that is ok for the game.
* We have had trouble with things like firewalls, especially on some Windows laptops, so if there are problems, make sure you can ping clients from the server and vice versa.

* Warmup round: run the web server with the `WARMUP` environment variable set (note that the result of running with `WARMUP=0` is undefined):

````
$ WARMUP=1 ruby web_server.rb
```shell script
WARMUP=1 ruby web_server.rb # or ./warmup.sh
````

* In the warmup round, just make sure that everyone has something technologically working, you just get the same request repeatedly. @bodil has provided some [nice sample players in different languages](https://github.com/steria/extreme_startup_servers).
Expand All @@ -87,5 +59,46 @@ People Who've Run Extreme Startup Sessions
* http://www.nilswloka.com/2011/08/17/code-dojo-extreme.html
* http://blog.xebia.fr/2012/07/19/extreme-startup-chez-xebia/
* https://blog.codecentric.de/en/2015/06/extreme-startup-at-codecentric/
If you run this workshop, please write it up on the internet and send us a link to add to this list.
Running "natively" (without Docker)
-----------------------------------
If you want to run the workshop without Docker you need to get this running (not tested in a few years):
* Install Ruby 1.9.3 and rubygems
* (For Windows)
* Install [Ruby DevKit](http://rubyinstaller.org/downloads/)
* Extract to (e.g.) c:\devkit
* cd c:\devkit
* ruby dk.rb init
* Edit the file config.yml (Add the locations where ruby is installed e.g. c:\Ruby193)
* ruby dk.rb install
* (For Ubuntu 12.04 onwards)
* Remove existing installation of Ruby and ruby related packages (do not use sudo or Ubuntu Software centre or any other Ubuntu package manager to install Ruby or any of its components)
* Remove rvm and related package from Ubuntu
* Install RVM using the instructions on https://rvm.io/
* In case RVM is broken it can be fixed by going to http://stackoverflow.com/questions/9056008/installed-ruby-1-9-3-with-rvm-but-command-line-doesnt-show-ruby-v/9056395#9056395
* Install Ruby and Rubygems using RVM only (for Rubygems use: 'rvm rubygems current' or 'rvm rubygems latest')
* See [Installing Nokogiri](http://nokogiri.org/tutorials/installing_nokogiri.html) for installing requirement
* sudo apt-get install libxslt-dev libxml2-dev
* (For Mac (Xcode 5.1 onwards))
* In the install instructions below you may need to supply an additional argument to ensure that Xcode does not treat an incorrect command line argument as a fatal error when installing Nokogiri.
* The argument is: `ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future` and can be prepended to the install commands.
* Read more here: https://developer.apple.com/library/ios/releasenotes/DeveloperTools/RN-Xcode/Introduction/Introduction.html
* Install dependencies:
````
cd ../<extreme startup dir>
gem install bundler
bundle install
````
* Start the game server
````
bundle exec ruby web_server.rb
````

0 comments on commit 63f8021

Please sign in to comment.