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: enables the full cosmo docker example to be built upon the latest rel… #1354

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gpazevedo
Copy link
Contributor

@gpazevedo gpazevedo commented Nov 8, 2024

Motivation and Context

The full cosmo docker example currently builds some images using the latest code, which may introduce instability due to untested changes. This PR modifies the example to use the last released code version for building images, ensuring greater stability and reliability.

To maintain flexibility, the --last-release flag has been added. When this flag is provided, the example will explicitly use the last released version. Otherwise, the current behavior is preserved.

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/cosmo-docs.
  • I have read the Contributors Guide.

@gpazevedo gpazevedo changed the title feat(examples): Enables the full Cosmo docker example to be built upon the latest rel… feat: Enables the full Cosmo docker example to be built upon the latest rel… Nov 8, 2024
@gpazevedo gpazevedo changed the title feat: Enables the full Cosmo docker example to be built upon the latest rel… feat: enables the full cosmo docker example to be built upon the latest rel… Nov 8, 2024
@StarpTech
Copy link
Contributor

Hi @gpazevedo thanks for the PR. Since this a monorepo, composed of multiple services. What commit are you referring to latest? IMO we would need a way to pass a set of ENV variables to the docker compose file to lock to specific version of the stack.

@gpazevedo
Copy link
Contributor Author

Hi @gpazevedo thanks for the PR. Since this a monorepo, composed of multiple services. What commit are you referring to latest? IMO we would need a way to pass a set of ENV variables to the docker compose file to lock to specific version of the stack.

Hi @StarpTech thanks for the review.
The "full-cosmo-docker" demo has two main steps:

  • Deploy locally the containers specified on the docker-compose.full.yml, that deliver all cosmo components and the demo subgraphs. One of them (cdn-server) is built using the current repository code, not necessarily the latest released version.
  • Create and publish a demo federated graph based on the demo subgraphs using the latest released "wgc".

I see two options to have a demo based on released versions:

  • Use the latest versions of each of the Cosmo components, and to do so, build the cdn-server image based on its latest release code;
  • Use the latest release of all Cosmo components when the latest "wgc" was released.

I chose to use the second option.
The command "git tag --sort=-v:refname" gets exactly this:
the latest version of the Cosmo component whose name is the last alphabetically (wgc)

I agree that we should be explicit about the chosen release.
I suggest filtering the releases to just the component chosen: wgc or cdn.
"git tag --sort=-v:refname | grep wgc | head -n 1"
instead of
"git tag --sort=-v:refname | head -n 1"

Did I understand it right?
What is the most adequate solution?

@StarpTech
Copy link
Contributor

I'd favor to use docker compose --env-file and maintaining a file with the locked release versions of all images.

Deploy locally the containers specified on the docker-compose.full.yml, that deliver all cosmo components and the demo subgraphs. One of them (cdn-server) is built using the current repository code, not necessarily the latest released version.

We can point all components to their docker image version. CDN is available on our docker repository, we don't have to build it. The only purpose of docker-compose.full.yml is to bootstrap Cosmo for local testing.

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.

2 participants