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

Gitpodify Couchers wrap up #1916

Merged
merged 17 commits into from
Sep 18, 2021
Merged

Gitpodify Couchers wrap up #1916

merged 17 commits into from
Sep 18, 2021

Conversation

darrenvong
Copy link
Member

@darrenvong darrenvong commented Sep 6, 2021

Taking over and wrapping up #1749. Added some instructions on using Gitpod in the frontend readme as another option for getting started!

Thanks @pawlean for introducing this to us in the first place :D

Open and test this at: https://gitpod.io/#https://github.com/Couchers-org/couchers/tree/backend/feature/gitpod-test

N/A on checklists, since no code changes to either frontend nor backend

@aapeliv
Copy link
Member

aapeliv commented Sep 6, 2021

Is there really no way to do this without the local companion app? The whole point of gitpodify would be to be able to run it in their VM and have a completely standardized environment with no local setup needed.

(Also, that link is 404-ing.)

@darrenvong
Copy link
Member Author

Unless there is a way to workaround the fact cookies aren't being set properly when it comes from 8888-xxx.gitpod.io to 3000-xxx.gitpod.io... I don't think so. Maybe setting COOKIE_DOMAIN to gitpod.io in the backend environment variable? But that's part of the docker compose so I don't know how we can override that without changing that too, or make a Gitpod copy of docker-compose.

@darrenvong
Copy link
Member Author

(Also, that link is 404-ing.)

The Gitpod badge link? It works for me (takes you to a login page, but should be fine once logged in with GitHub)

@aapeliv
Copy link
Member

aapeliv commented Sep 7, 2021

Maybe setting COOKIE_DOMAIN to gitpod.io in the backend environment variable?

That should be pretty straightforward, I think.

(Also, that link is 404-ing.)

The Gitpod badge link? It works for me (takes you to a login page, but should be fine once logged in with GitHub)

This link was failing: https://www.gitpod.io/blog/local-app. Either it was down very briefly (it's back up now), or they're doing some odd stuff with SSR and it defaults to a 404! I was getting that on all docs pages for a sec.

@darrenvong
Copy link
Member Author

That should be pretty straightforward, I think.

Can it be done without creating another docker-compose and .env file though? Also I think the media stuff will still be broken, but that's broken locally anyway so maybe less of a big deal

@aapeliv
Copy link
Member

aapeliv commented Sep 7, 2021

Yeah I think you can just add env vars before the docker-compose command.

@aapeliv
Copy link
Member

aapeliv commented Sep 7, 2021

No, actually; that probably won't work. Sorry, I misunderstood something.

I think we can create an override docker-compose file though. Something like docker-compose.gitpod.yml which only contains the overrides; then you can do something like docker-compose -f docker-compose.yml -f docker-compose.gitpod.yml ... and it should override the stuff specified in the latter file: https://docs.docker.com/compose/extends/#multiple-compose-files

@darrenvong
Copy link
Member Author

darrenvong commented Sep 7, 2021

That extra docker-compose.gitpod.yml override did the trick and fixed the cookies issue! 🚀 So now it's all working within the browser:

https://gitpod.io/#https://github.com/Couchers-org/couchers/tree/backend/feature/gitpod-test

I've also updated the README and removed the reference to the companion app, so now it is really all on in the browser!

aapeliv
aapeliv previously requested changes Sep 7, 2021
Copy link
Member

@aapeliv aapeliv left a comment

Choose a reason for hiding this comment

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

Getting very nitpicky... sorry!

readme.md Outdated Show resolved Hide resolved
app/frontend/README.md Outdated Show resolved Hide resolved
app/docker-compose.yml Show resolved Hide resolved
.gitpod.yml Show resolved Hide resolved
.gitpod.yml Outdated Show resolved Hide resolved
.gitpod.yml Outdated Show resolved Hide resolved
@aapeliv
Copy link
Member

aapeliv commented Sep 7, 2021

Just tried running this. It's looking good!

A few more things that I noticed:

  • Map isn't loading because the dev key isn't set to allow .gitpod.io: I'll see if I can fix this one up
  • In the same way you set COOKIE_DOMAIN, you should set BASE_URL to gp url 3000, so that e.g. signup links point to the right place. This might be a tad more tricky :/

@aapeliv
Copy link
Member

aapeliv commented Sep 7, 2021

Map isn't loading because the dev key isn't set to allow .gitpod.io: I'll see if I can fix this one up

Tried to fix this

@darrenvong
Copy link
Member Author

darrenvong commented Sep 8, 2021

Map isn't loading because the dev key isn't set to allow .gitpod.io: I'll see if I can fix this one up

Tried to fix this

Is that a setting in some couchers mapbox account? Any luck?

In the same way you set COOKIE_DOMAIN, you should set BASE_URL to gp url 3000, so that e.g. signup links point to the right place. This might be a tad more tricky :/

Yeah I think that might be difficult without some command to substitute in the value into the file itself before spinning the Docker containers up, but then people might end up accidentally committing those changes so I'm not sure that's a good idea :/ lol maybe the companion app is still the easiest way due to how finicky our setup is / Gitpod's domains are too dynamic

@aapeliv
Copy link
Member

aapeliv commented Sep 8, 2021

In the same way you set COOKIE_DOMAIN, you should set BASE_URL to gp url 3000, so that e.g. signup links point to the right place. This might be a tad more tricky :/

Yeah I think that might be difficult without some command to substitute in the value into the file itself before spinning the Docker containers up, but then people might end up accidentally committing those changes so I'm not sure that's a good idea :/ lol maybe the companion app is still the easiest way due to how finicky our setup is / Gitpod's domains are too dynamic

I think if you add to the gitpod override docker compose file like this

version: "3"
services:
  backend:
    environment:
      - BASE_URL

with no value, then I think you should be able to pass BASE_URL from the command line, by doing BASE_URL=$(gp url 3000) docker-compose ....

https://docs.docker.com/compose/environment-variables/#pass-environment-variables-to-containers

@aapeliv
Copy link
Member

aapeliv commented Sep 8, 2021

@darrenvong could you review please? (You made the pr so can't ask for review through gh)

.gitpod.yml Outdated Show resolved Hide resolved
@darrenvong
Copy link
Member Author

Just tried with my latest tweaks and this looks good to me! Can't approve it as I originally opened the PR 😅

Copy link
Member

@lucaslcode lucaslcode left a comment

Choose a reason for hiding this comment

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

Works for me :)

@lucaslcode lucaslcode merged commit 2c247af into develop Sep 18, 2021
@lucaslcode lucaslcode deleted the backend/feature/gitpod-test branch September 18, 2021 21:21
@aapeliv aapeliv added release notes: pending Add to stuff that should be included in release notes release notes: done Was mentioned in release notes and removed release notes: pending Add to stuff that should be included in release notes labels Sep 26, 2021
aapeliv pushed a commit that referenced this pull request Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.topic devops release notes: done Was mentioned in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants