Skip to content

Add Lab to quickstart #678

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

Merged
merged 23 commits into from
Jul 3, 2025
Merged

Add Lab to quickstart #678

merged 23 commits into from
Jul 3, 2025

Conversation

fnando
Copy link
Member

@fnando fnando commented Apr 1, 2025

No description provided.

@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Apr 1, 2025
@leighmcculloch
Copy link
Member

What's the impact on image size and container memory and cpu usage?

Copy link
Member

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

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

🎉🥳🎉🥳🎉🥳🎉🥳🎉🥳

@@ -26,6 +27,7 @@ export PGPORT=5432
: "${ENABLE_LOGS:=false}"
: "${ENABLE_CORE:=false}"
: "${ENABLE_HORIZON:=false}"
: "${ENABLE_LAB:=false}"
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove the enable lab env and instead rely on the enable env var? The other ones for core and horizon are legacy.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, the env can stay, but can we hook it into the ENABLE car as well?

Copy link
Member

Choose a reason for hiding this comment

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

This comment was marked as resolved, but enabling lab was not hooked into the ENABLE variable.

To do that you need to add a block that looks something like this to where the blocks like that exist already in this file:

  if [[ ",$ENABLE," = *",lab,"* ]]; then
    ENABLE_LAB=true
  fi

Copy link
Member

Choose a reason for hiding this comment

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

@fnando
Copy link
Member Author

fnando commented Apr 1, 2025

What's the impact on image size and container memory and cpu usage?

@leighmcculloch Unfortunately, is node.js tire fire all around.

$ du -hs /stellar/lab/node_modules/
786M	/stellar/lab/node_modules/

$ du -hs /stellar/lab/build/
314M	/stellar/lab/build/

As for memory and cpu, it should be fine.

$ ps auxwww | grep next
stellar      619  0.1  0.3 22331024 125484 pts/0 Sl   01:52   0:01 next-server (v14.2.26)

@leighmcculloch
Copy link
Member

Oof. I think we should make changes to Lab if needed to make it generatable as a static website. An additional 1GB of image size is multiple times the current size of the image.

@sagpatil
Copy link
Contributor

we do have AHA waiting on this for scaffold-stellar. I think we should get this merged in and unblock them. while we get an optimization to reduce the image size

@fnando fnando force-pushed the add-lab-to-quickstart branch from 616aae2 to 428241f Compare June 30, 2025 19:24
@fnando fnando force-pushed the add-lab-to-quickstart branch from c0fab9a to 8cede7f Compare June 30, 2025 20:27
@fnando fnando force-pushed the add-lab-to-quickstart branch from 8cede7f to a28757e Compare June 30, 2025 20:29
@sagpatil sagpatil requested a review from Copilot June 30, 2025 22:29
@fnando fnando marked this pull request as ready for review June 30, 2025 22:29
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new Lab component to the quickstart, enabling the Stellar Laboratory service to be built, deployed, and run alongside the existing services.

  • Introduces environment variables and startup configuration for the Lab service.
  • Adds a dedicated Dockerfile for the Lab image and updates the build, Makefile, and supervisor configurations accordingly.
  • Updates GitHub workflows to cache, build, and load the Lab image.

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
start Added environment variable and service start block for Lab.
common/supervisor/etc/supervisord.conf.d/stellar-lab.conf Created supervisor configuration for the Lab process.
common/nginx/etc/conf.d/lab.conf Added NGINX proxy configuration for Lab.
Makefile Added LAB_REF variable and build-deps target for Lab.
Dockerfile.lab New Dockerfile for building the Lab image.
Dockerfile Updated to include the Lab stage and copy Lab assets and binaries.
.github/workflows/* Updated workflows to include build, cache, and loading steps for Lab.
Comments suppressed due to low confidence (3)

Makefile:81

  • [nitpick] Consider adding a comment to document the use of NEXT_PUBLIC_COMMIT_HASH in the Lab build target to assist future maintainers in understanding its purpose.
build-deps-lab:

.github/workflows/build.yml:324

  • The disk cleanup commands remove several system directories with sudo; please confirm these removals are safe within the CI environment and won’t affect subsequent steps.
        sudo rm -rf /usr/share/dotnet

Dockerfile:37

  • [nitpick] Ensure that the permissions and paths of the Node.js binaries being copied from the Lab stage match the expected environment requirements to avoid runtime issues.
COPY --from=lab /usr/local/bin/node \

@fnando fnando force-pushed the add-lab-to-quickstart branch from 2f9a208 to e24b36b Compare July 2, 2025 21:42
@fnando fnando merged commit 61c3965 into main Jul 3, 2025
367 of 371 checks passed
@fnando fnando deleted the add-lab-to-quickstart branch July 3, 2025 22:02
@github-project-automation github-project-automation bot moved this from Backlog (Not Ready) to Done in DevX Jul 3, 2025
Copy link
Member

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

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

@fnando Couple asks inline, can you follow up w ith?

RUN git fetch origin ${NEXT_PUBLIC_COMMIT_HASH}
RUN git checkout ${NEXT_PUBLIC_COMMIT_HASH}
RUN rm -rf .git
RUN yarn install
Copy link
Member

Choose a reason for hiding this comment

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

yarn install is not guaranteed to be reproducible. We need to add the --frozen-lockfile option to ensure it is. Can we do that here to make sure that we never build dependencies into the quickstart image that haven't been tested and run through the normal test processes of lab?

Copy link
Member

Choose a reason for hiding this comment

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

@@ -26,6 +27,7 @@ export PGPORT=5432
: "${ENABLE_LOGS:=false}"
: "${ENABLE_CORE:=false}"
: "${ENABLE_HORIZON:=false}"
: "${ENABLE_LAB:=false}"
Copy link
Member

Choose a reason for hiding this comment

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

This comment was marked as resolved, but enabling lab was not hooked into the ENABLE variable.

To do that you need to add a block that looks something like this to where the blocks like that exist already in this file:

  if [[ ",$ENABLE," = *",lab,"* ]]; then
    ENABLE_LAB=true
  fi

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

Successfully merging this pull request may close these issues.

3 participants