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

[FEAT] Gitpod Script #203

Merged
merged 65 commits into from
Dec 2, 2022
Merged

Conversation

Palanikannan1437
Copy link
Contributor

@Palanikannan1437 Palanikannan1437 commented Nov 23, 2022

Issue in brief

Create an optimised Gitpod script for the project so that contributors and community builders can enjoy bam boom boom kapow 🤯!! speeds to setup and work on the codebase⚡️!

Suggested Fixes/Changes

  • Added init tasks in .gitpod.yml and separated tasks so that pre-builds can be run efficiently
  • Tasks that run during initialisation (init) for caching via pre-builds
    • Install Faunadb: Pulls fauna image from docker hub so that the results can be cached until next commit(pre-builds)
    • Init Next.js App: Install all npm packages for the Next.js app in the app directory
    • Init Strapi App: Install all npm packages for the Strapi app in the cms directory and build for production
  • Tasks that run during runtime(command)
    • Init Strapi App: Starts the Stapi service
    • Start build: Starts the Next.js app once the Strapi app starts
  • init tasks are performed asynchronously for max optimization and then the command tasks are awaited based on the init tasks
  • Extracted the initialisation logic from the main build script into strapi.sh only for the gitpod-scripts for faster async loading!
  • Extracted and modified necessary existing scripts into gitpod-scripts
  • Fixed the bug of Next.js app starting before the Strapi service by awaiting for the Strapi port to start listening!
  • Updated Readme for instructions on how to use pre-builds in Gitpod for their forked version!
  • Committed updated package-lock.json for keeping this package-lock.json as a baseline for further development to avoid conflicts while initialising gitpod workspace

Demo

The magical dev-workflow with pre-builds on Gitpod enabled from a new contributor/community builder's perspective!

rc4comm.gitpod.mov

PS: These number of commits were made just in-order to test the immediate changes I make on Gitpod, I'll consider squashing them if needed, thank you😄

@Palanikannan1437 Palanikannan1437 marked this pull request as ready for review November 25, 2022 06:49
@Palanikannan1437
Copy link
Contributor Author

Looking good @Palanikannan1437 - can't wait to try this!

@Sing-Li and @Dnouv it'd be awesome if you could review this and see it in action ⚡️

Please let me know incase there are some changes to be made, thank you 😄

@Dnouv
Copy link
Member

Dnouv commented Nov 25, 2022

I am on it. I just noticed a bug in that the RC4Community database is not getting initialized. Maybe we can fix it by tweaking the startup shell script; I will take a look at the script.

Update:
The following is the error for every new workspace @Palanikannan1437

Waiting 30 seconds for container to get shipped...
Docker container needs extra startup time, please increase the $waittlist value in initFaunaOnce.sh
Process ended with health status of Container: starting

While building on Gitpod; it takes an unusually long time for the Fauna container to start. This results in an empty database, thus skipping the data initialization.

Thank you!

@Palanikannan1437
Copy link
Contributor Author

I am on it. I just noticed a bug in that the RC4Community database is not getting initialized. Maybe we can fix it by tweaking the startup shell script; I will take a look at the script.

Update: The following is the error for every new workspace @Palanikannan1437

Waiting 30 seconds for container to get shipped...
Docker container needs extra startup time, please increase the $waittlist value in initFaunaOnce.sh
Process ended with health status of Container: starting

While building on Gitpod; it takes an unusually long time for the Fauna container to start. This results in an empty database, thus skipping the data initialization.

Thank you!

@Dnouv I've now fixed the script to dynamically increase the waittime by 5s until the container starts...with an upper limit of 60s, would be awesome if you could test it out now, thank you so much for the guidance! 😄

superprofile/initFaunaOnce.sh Outdated Show resolved Hide resolved
superprofile/initFaunaOnce.sh Outdated Show resolved Hide resolved
@Dnouv
Copy link
Member

Dnouv commented Nov 28, 2022

LGTM! Thanks for the hard work @Palanikannan1437

cc: @Sing-Li

@Palanikannan1437
Copy link
Contributor Author

LGTM! Thanks for the hard work @Palanikannan1437

cc: @Sing-Li

Thanks @Dnouv!

.vscode/settings.json Show resolved Hide resolved
@Sing-Li Sing-Li merged commit 7e8d773 into RocketChat:master Dec 2, 2022
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.

[TODO] Update gitpod Yaml
3 participants