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

[93] New Docker command to generate DockerFiles of specified services #34

Merged
merged 25 commits into from
Sep 21, 2024

Conversation

Savio629
Copy link
Collaborator

@Savio629 Savio629 commented Jun 20, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: SamagraX-Stencil/stencil#135 (comment)

schematics link: SamagraX-Stencil/schematics#10

What is the new behavior?

stencil docker <services...>
where <services> = monitoring logging temporal

Does this PR introduce a breaking change?

[ ] Yes
[ ] No

Other information

@Savio629 Savio629 marked this pull request as ready for review June 20, 2024 14:10
@Savio629 Savio629 changed the title New Docker command to generate DockerFiles of specified services [93] New Docker command to generate DockerFiles of specified services Jun 25, 2024
Copy link

coderabbitai bot commented Jun 27, 2024

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Savio629
Copy link
Collaborator Author

Updated existing test and implemented e2e test for docker command

@Savio629
Copy link
Collaborator Author

Savio629 commented Jun 30, 2024

Completed:

  • Implemented Docker Command
    • Tooling specific setup
    • À la Carte setup
  • Updated stencil cli docs - Docker command
  • Updated existing test and implemented e2e test for docker command
  • --path argument in À la Carte setup
  • Updated docker-start.sh
  • Integrate the --docker Flag

@techsavvyash techsavvyash linked an issue Jul 4, 2024 that may be closed by this pull request
@Savio629
Copy link
Collaborator Author

Savio629 commented Jul 11, 2024

README.md for Docker Command

Docker Command

stencil docker <services...> [options]
stencil do <services...> [options]

Description

Creates a docker service/container for given command.

  • Tooling specific setup
    • Creates a folder with the given <service> inside docker directory
  • À la Carte setup / Adhoc setup
    • Creates a docker compose or updates existing docker compose with desired <service>

Arguments

Argument Description
<service> The name of the new project

Options

Option Description
--path [path] The path where the docker compose will be generated

Note: Docker command supports multiple services at a time.

Services

  • Tooling specific setup
Name Alias Description
logging lg Generates a docker service for logging
monitoringService ms Generates a docker service for monitoring
temporal tp Generates a docker service for temporal
  • À la Carte setup / Adhoc setup
Name Alias Description
postgres pg Generate a docker compose for postgres
hasura hs Generate a docker compose for hasura

How to include new docker services ?

Stencil-cli

  1. Include the docker service in lib/schematics/nest.collection.ts with its name, alias and description.

Schematics

  1. Create a folder inside of schematics package under src/lib/docker/nameOfDockerService
  2. If the dockerService is a tooling setup then refer existing tooling setups such as temporal,monitoringService, logging.
    • Create src/lib/docker/files/ts/nameOfDockerService and paste all the necessary files needed to be generated when the service is called.
    • Create factory file, schema file and interface of the dockerService inside src/lib/docker/nameOfDockerService by refering existing tooling setup.
  3. If the dockerService is a adhoc setup then refer existing adhoc setup such as postgres, hasura.
    • Create factory file, schema file and interface of the dockerService inside src/lib/docker/nameOfDockerService by refering existing adhoc setup.
    • Paste the docker-compose and .env content inside of factory file refering existing adhoc setup.

Which files will be changed/updated?

Tooling setup

  • Basically whenever tooling setup is generated eg. stencil docker temporal , docker/temporal will be created.

Adhoc Setup

  • Whenever adhoc setup is generated eg. stencil docker postgres , then docker-compose, .env and docker-start.sh is generated/updated.

Docker-readme.md Outdated Show resolved Hide resolved
);
const schematicOptions: SchematicOption[] = this.mapSchematicOptions(commandInputs);
schematicOptions.push(
new SchematicOption('language', 'ts'),
Copy link
Member

Choose a reason for hiding this comment

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

why have we hardcoded to ts

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this was already present with new command
It is the default language which is pushed if no language is given by the user

actions/new.action.ts Outdated Show resolved Hide resolved
actions/new.action.ts Outdated Show resolved Hide resolved
actions/new.action.ts Show resolved Hide resolved
actions/new.action.ts Outdated Show resolved Hide resolved
actions/new.action.ts Outdated Show resolved Hide resolved
actions/new.action.ts Outdated Show resolved Hide resolved
actions/new.action.ts Outdated Show resolved Hide resolved
actions/new.action.ts Outdated Show resolved Hide resolved
@Savio629
Copy link
Collaborator Author

  • Resolved all the comments
  • Added minio and fusionauth in the docker command
  • Tested the commands well

@Savio629
Copy link
Collaborator Author

image

@techsavvyash techsavvyash merged commit c8cfd32 into SamagraX-Stencil:dev Sep 21, 2024
1 check passed
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.

[schematics] uniform files structure
2 participants