Open-Historical-Map-Labs / openhistoricalmap-docker

A dockerized configuration to create the OpenHistoricalMap backend
9 stars 3 forks source link

Update deployment pipeline for new OHM-Labs org repos #22

Closed danrademacher closed 4 years ago

danrademacher commented 4 years ago

Moving repos to this org has broken some things on staging:

  1. This commit points to corrected GH Pages resources: https://github.com/Open-Historical-Map-Labs/ohm-website/commit/e301d5c6aae6b62db18f3f6789644b729182e935, need to get deployed on AWS
  2. But that means updating the git submodule for ohm-website and then changingCode-Deploy to point at this repo.

this might be simple.

danrademacher commented 4 years ago

Also should be assigned to @batpad, but his invitation is still pending.

danrademacher commented 4 years ago

Hmm, I did just have to press "Grant" here: image

Pushed this empty commit again https://github.com/Open-Historical-Map-Labs/openhistoricalmap-docker/commit/f1288e7b37e49ab1aa4bc7e4c7d4f127f6f7f0a2, to test.

danrademacher commented 4 years ago

Hmm, that didn't seem to cause the Pipeline to try to run... though we do have a multiple payloads showing as run this AM: image

danrademacher commented 4 years ago

Hmm, all my empty commits failed to cause the Pipeline to run BUT clicking this button: image

made it happen: image

We shouldn't have to click that button every time, but at least we CAN click that button!

Gotta run, but will check back shortly to see if its working after build and deploy go through

danrademacher commented 4 years ago

Hmm, well I dislodged the Code Pipeline and got that flowing again. Now we have CORS issues with resources from Github Pages... but a step closer to running!

I鈥檓 phone only and was checking by tempting into my Mac ... Which means no screenshot of errors. Will post in a bit

danrademacher commented 4 years ago

Ok, so we have the staging site working again, but the deploys still only happen when I press that big orange "Release Change" button, so not exactly CI/CD. I think it must still be the webhooks must still somehow be tied up with older repo URL or something

geohacker commented 4 years ago

@danrademacher thank you getting us so close! I think I managed to resolve this trigger issue -- now any commit to master will trigger a CodePipeline build.

This is how I approached the issue:

I'm pretty sure this is some kind of an edge case were the hook gets created but it's not registered properly with Github. The token stuff shouldn't be required in case we run into this again.

@danrademacher I'll let you verify/test this with a commit and let us know next steps. cc @batpad

danrademacher commented 4 years ago

Confirmed working here as well!

image

(side note, I have notifications set up and feeding into a #github-ohm channel in our GreenInfo slack, which is the source of the above screenshot

danrademacher commented 4 years ago

Hmm, not so fast: image

danrademacher commented 4 years ago

Link to the failure message, scroll way down for : https://console.aws.amazon.com/codesuite/codebuild/projects/website/build/website%3A0c953fd2-6813-4a33-9fb4-b86472de7ff9/log?region=us-east-1

Weird. I assume this is related, but the failure mode is quite different. Any ideas on what's going on?

Can you try and replicate?

geohacker commented 4 years ago

Ha, that's weird indeed. Looks like npm install fails with:

路[91mnpm ERR! code路[0m路[91m EEXIST 
npm ERR! syscall symlink 
路[0m路[91mnpm ERR! path ../lib/node_modules/jpegtran-bin/cli.js 
npm ERR! dest /usr/bin/jpegtran 
路[0m路[91mnpm ERR! 路[0m路[91merrno -17 
路[0m路[91mnpm ERR!路[0m路[91m EEXIST: file already exists, symlink '../lib/node_modules/jpegtran-bin/cli.js' -> '/usr/bin/jpegtran' 
npm ERR! File exists: /usr/bin/jpegtran 
路[0m路[91mnpm ERR!路[0m路[91m Remove the existing file and try again, or run npm 
npm 路[0m路[91mERR! with --force to overwrite files recklessly. 
路[0m路[91m 
路[0m路[91mnpm ERR! A complete log of this run can be found in: 
npm ERR!     /root/.npm/_logs/2019-12-12T01_50_57_517Z-debug.log 

I'm going to send the hook again to see if it was just a temporary hiccup.

geohacker commented 4 years ago

This is a bit mysterious. It didn't recover by itself. I tried building the image locally and that worked just fine.

A thing to check would if the AWS AMI or something has changed? cc @batpad if you have any clues.

danrademacher commented 4 years ago

Discussion today with Sajjad -- must be some issue with alignment of Docker and the AMI, since this error doesn't occur locally. Sajjad will find AMI id and investigate more closely tomorrow and post notes here.

geohacker commented 4 years ago

So few more thoughts as I look at this:

I've confirmed that:

geohacker commented 4 years ago

Build works now after merging #25. @danrademacher let me know if you get a chance to test and everything looks ok.

danrademacher commented 4 years ago

Just ran and confirmed the build pipeline is fixed for me too