pioneers / website

PiE's public-facing website, built on Jekyll.
https://pioneers.berkeley.edu
Apache License 2.0
5 stars 47 forks source link

[WIP] Deployment update #486

Closed scottnuma closed 6 years ago

scottnuma commented 6 years ago

This PR seeks to update how the website runs on the server and bring it to better match how we develop.

This PR should be reviewed and merged after #485 for best comparison

scottnuma commented 6 years ago

Updating the Web Dev Setup

scottnuma commented 6 years ago

Hmm, probably around 2 am in CA is good. so likely 5 pm your time? During the summer at that time I doubt many people would notice any interruption.

kev-chien commented 6 years ago

I tried to deploy but this happened:

start log

Kevin@KevintekiMacBook-Air website (pioneers/master) $ git push dokku@apple.pierobotics.org:website master Counting objects: 39, done. Delta compression using up to 4 threads. Compressing objects: 100% (39/39), done. Writing objects: 100% (39/39), 5.08 KiB | 0 bytes/s, done. Total 39 (delta 20), reused 0 (delta 0) -----> Cleaning up... -----> Building website from dockerfile... -----> Setting config vars DOKKU_DOCKERFILE_PORTS: 4000 -----> Setting config vars DOKKU_DOCKERFILE_ENTRYPOINT: ENTRYPOINT ["jekyll"] -----> Setting config vars DOKKU_DOCKERFILE_CMD: CMD ["serve"] remote: build context to Docker daemon 254.5MB Step 1/7 : FROM jekyll/jekyll:3.0.2 ---> ee484fdd8667 Step 2/7 : MAINTAINER Scott Numamoto scott.numamoto@pioneers.berkeley.edu ---> Using cache ---> d8b5a010c977 Step 3/7 : ADD . /srv/jekyll ---> f344051f234f Removing intermediate container b01228bcfe12 Step 4/7 : VOLUME /srv/jekyll ---> Running in f89d1f7c4ab4 ---> e0ce09fb1252 Removing intermediate container f89d1f7c4ab4 Step 5/7 : EXPOSE 4000 ---> Running in 5fe4a663f165 ---> ec95d0839f70 Removing intermediate container 5fe4a663f165 Step 6/7 : ENTRYPOINT jekyll ---> Running in 758b848ab19f ---> 7fdaca201f29 Removing intermediate container 758b848ab19f Step 7/7 : CMD serve ---> Running in 675eec10102d ---> 90a0fb1dba91 Removing intermediate container 675eec10102d Successfully built 90a0fb1dba91 Successfully tagged dokku/website:latest -----> Releasing website (dokku/website:latest)... -----> Deploying website (dokku/website:latest)... -----> Attempting to run scripts.dokku.predeploy from app.json (if defined) -----> No Procfile found in app image -----> DOKKU_SCALE file found (/home/dokku/website/DOKKU_SCALE) =====> web=1 remote: Error: No public port '4000/tcp' published for 8960ea30e6f314371ce4e80a61b10f14306a050d1372592a854f69b86944eb57 -----> Attempting pre-flight checks For more efficient zero downtime deployments, create a file CHECKS. See http://dokku.viewdocs.io/dokku/deployment/zero-downtime-deploys/ for examples CHECKS file not found in container: Running simple container check... -----> Waiting for 10 seconds ... 8960ea30e6f314371ce4e80a61b10f14306a050d1372592a854f69b86944eb57 remote: App container failed to start!! =====> website web container output: /usr/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/spec_set.rb:94:in 'block in materialize': Could not find concurrent-ruby-1.0.5 in any of the sources (Bundler::GemNotFound) from /usr/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/spec_set.rb:87:in 'map!' from /usr/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/spec_set.rb:87:in 'materialize' from /usr/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/definition.rb:137:in 'specs' from /usr/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/definition.rb:182:in 'specs_for' from /usr/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/definition.rb:171:in 'requested_specs' from /usr/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/environment.rb:18:in 'requested_specs' from /usr/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:13:in 'setup' from /usr/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler.rb:92:in 'setup' from /usr/lib/ruby/gems/2.2.0/gems/jekyll-3.0.2/lib/jekyll/plugin_manager.rb:38:in 'require_from_bundler' from /usr/lib/ruby/gems/2.2.0/gems/jekyll-3.0.2/bin/jekyll:13:in '<top (required)>' from /usr/bin/jekyll:22:in 'load' from /usr/bin/jekyll:22:in '

'

(the above error repeated several times) end log

From looking at the log, Docker file being used seems to be the previous Dockerfile using the Jekyll image, and so whatever we do to this Dockerfile in the Github repo doesn't change the actual Dockerfile used for deployment. @quantumfusion could you look into updating the actual Dockerfile on Dokku? Thanks!

Also I tried building Scott's Dockerfile on my machine and it succeeded, so I believe the Dockerfile itself should work fine in the deployment environment.

quantumfusion commented 6 years ago

So... I have no idea what was causing those problems. However, I pushed a promotion up to prod and it looks like it went fine.

Btw, @scottnuma what is up with this WIP man. Gotta keep that git history fresh... I mean clean.

Also, just noticed that you mention the need to monitor after deployment. Dokku supports post-deploy checks, so it may be worthwhile to look into adding some scripts there to confirm a successful deploy.

scottnuma commented 6 years ago

Mm, didn't pay attention to renaming. I'll get that for the future

Will look in to post-deploy checks stuff