-
Notifications
You must be signed in to change notification settings - Fork 36
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
docs(example): add share-services #137
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feat(example)
or docs(example
)? Because this PR doesn't add new features to services-flake.
So this share-services example is more of demonstration of how the process-compose-flake module system can be used to share services, right? I wonder if we can improve it in a couple of ways:
- Have two separate flakes --
share-services/common
,share-services/foo
-- where foo imports services from common. The integration test can just remain in foo. I think this is more clear (re: structure) to the user. In fact, we might as well add a bar flake that imports common again. - Instead of running empty pg1 and r1, what if we had something equally demo-worthy as example/simple (which shows pgweb)?
Perhaps we can just clone services-flake/example/simple/flake.nix Lines 30 to 39 in 961bfd3
And then use it, for running pgweb, from services-flake/example/flake.nix Lines 49 to 57 in 218fa6c
? That's one idea. Interestingly, in future we can create another example to demonstrate creation of new services, by refactoring this pgweb into its own service ( |
This example comprises of two flakes: 1. databases: defining the two postgres services 2. frontend: reusing the postgres services from `databases` to start `pgweb` and provide a visual DB editor.
@srid I have so far implemented this. Although, I am not super pleased with the way services.nix is being used between |
Its not a bug, data will still remain in pwd, only the socket will be created elsewhere. Hence, the options, |
# Required due to socket length being limited to 100 chars, see: https://github.com/juspay/services-flake/pull/77 | ||
socketDir = "$HOME/.services/postgres/pg1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this break if running two test builds in parallel?
Also: #139 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will, yes! It should probably depend on a tmp path, rather than a pre-defined one. Gotta think about this one.
Also, if we move the |
Simple, as in ? |
This comment was marked as resolved.
This comment was marked as resolved.
n/m - that's just old code in the PR. |
n/m, I was thinking of just having
But such simple cases are anyways covered in the "Getting started" section of the service documentation. |
Good enough, we can always improve our examples later, and add more of them. I'll merge, and flip the branch name in |
Run services:
nix run "github:juspay/services-flake/share-services?dir=example/share-services"
Run integration-test: