Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Mapknitter running into the Google Cloud. #1260

Closed
wants to merge 46 commits into from
Closed

Conversation

icarito
Copy link
Member

@icarito icarito commented Apr 15, 2020

This is currently tested running at unstable.mapknitter.org.

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/mapknitter-reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

alaxalves and others added 30 commits April 14, 2020 12:10
* Add coveralls

* Fix gemfile

* Fix env variable

* Add coveralls token

* Update README.md
* Shortening docker image in ~30%

* Caching bundle, gathering env variables and using newer sintax

* Creating startup script and env file

* Improving travis CI configuration

* Loading assets in production env

* Allow uglifier to interpret ES6

* Don't dettach when building container in travis

* Fix start command

* Fix travis script

* Try to resolve travis tests invocation

* Tweak travis script

* Add delay

* Bundle install before db setup

* Shortening docker image in ~30%

* Caching bundle, gathering env variables and using newer sintax

* Creating startup script and env file

* Improving travis CI configuration

* Loading assets in production env

* Allow uglifier to interpret ES6

* Fix start command

* Fix travis script

* Tweak travis script

* Add delay

* Revert assets changes

* Return to Mysql5.7

* Tweak travis script

* Fix make redeploy-container command

* Add db migrate and precompile step.

* Add bower install to Makefile

* Clean after docker run. Avoid one bower run.
* Dynamic port in compose file

* Omit setting container name

* Add initial sql dump entry

* Avoid resetting database on build
* Switch back to Debian 9 Stretch

* Simplify docker image

* Bump Ruby to 2.4.6

* Re-add dependency

* Add dependency (zip)

* Try pip install gdal

* Install libgdal-dev

* Revert attept to use pip

* Bump ruby

* Avoid naming containers in compose file

* Avoid overwriting database on redeploy-container

* Allow to load mysql dump

* Include own GDAL packages

* Disable ipv6 to prevent error

* Add missing Amazon S3 yml to Makefile

* Document unstable instance
@codeclimate
Copy link

codeclimate bot commented Apr 15, 2020

Code Climate has analyzed commit 71d97ec and detected 0 issues on this pull request.

View more on Code Climate.

docker-compose build

deploy-container:
docker-compose run --rm web bash -l -c "sleep 10 && bower install --allow-root && rake db:setup && rake db:migrate && rake assets:precompile"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wait_for_container() method dismisses the need of ...sleep 10..., in MK we're not using Bower anymore, I remember we've switched to Yarn a while ago. Also, I think those commands such as rake * commands are already defined at the script.sh file, here -> https://github.com/publiclab/mapknitter/blob/main/start.sh.

username: mapknitter
password: mapknitter
database: mapknitter
host: <%= ENV.fetch('DB_HOST') || 'db' %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here should be ENV.fetch("MYSQL_HOST") { 'db' }, that's a env.fetch() notation. It get db as the value for MYSQL_HOST, if not defined. Either this or ENV.fetch("MYSQL_HOST", "db") will work. https://ruby-doc.org/core-2.5.0/ENV.html#method-c-fetch


if [ -f $pidfile ] ; then
>&2 echo 'Server PID file already exists. Removing it...';
rm $pidfile;
fi

forego start
bundle exec rails s -p $PORT -b '0.0.0.0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to run rails using Forego otherwise ActionCable won't work. Check out cee7479

@@ -5,7 +5,6 @@
SimpleCov.formatter = SimpleCov::Formatter::Codecov
SimpleCov.start

require "rack_session_access/capybara"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think system tests will work with this missing 🤔

public/tms/*
db/schema.rb
*.db
<<<<<<< HEAD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You got merge conflicts here

@alaxalves
Copy link
Member

@icarito @jywarren Just pushed an updated version of this at #1271 Check that out pls 😉

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

Successfully merging this pull request may close these issues.

3 participants