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

Support MP deployments with self-generated TLS certificate #3721

Merged
merged 1 commit into from
May 8, 2024

Conversation

frrist
Copy link
Member

@frrist frrist commented Mar 27, 2024

Generates a TLS certificate for communication between clients and requester node.

Copy link
Contributor

coderabbitai bot commented Mar 27, 2024

Important

Auto Review Skipped

Auto reviews are disabled on this repository.

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.


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

Copy link
Collaborator

@aronchick aronchick left a comment

Choose a reason for hiding this comment

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

LGTM other than the password/defaults.

@@ -17,9 +17,9 @@ bacalhau_accept_networked_jobs = true

bacalhau_otel_collector_endpoint = "http://analytics.bacalhau.tech:4318"

bacalhau_requester_api_token = "token_for_requester_api"
bacalhau_compute_api_token = "token_for_compute_api"
bacalhau_requester_api_token = "password"
Copy link
Collaborator

Choose a reason for hiding this comment

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

did you mean to check in these as defaults? Terraform offers a feature to generate a random string (or this should be left blank and required)

Copy link
Member Author

@frrist frrist Mar 28, 2024

Choose a reason for hiding this comment

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

If these values are blank a random token will automatically be generated and used. I commit this since typing password was easier than the former when dev-ing.

Copy link
Member

Choose a reason for hiding this comment

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

I hate that we auto-generate tokens and ask the users to go through the logs or to a local file on desk to get whatever token was generated. We should either allow unsecure access by default, or fail if no token was provided. but we shouldn't auto generate tokens

Copy link
Member Author

Choose a reason for hiding this comment

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

I hate that we auto-generate tokens

As mentioned above, we only auto generate tokens if the users don't provide one as part of the deployment. Users are able to set the token to whatever value they'd like to use, and in the event they do so we will not auto-generate a token and use the one they've provided.

ask the users to go through the logs or to a local file on desk to get whatever token was generated

Tokens are returned via terraform outputs once the deployment completes. Users do not need to look in the logs for the tokens.

We should either allow unsecure access by default, or fail if no token was provided. but we shouldn't auto generate tokens

What's the motivation for this? I believe it's a some-what standard practice to generate a password (token) on the behalf of a user and instruct them to change it once they login, no?

Copy link
Collaborator

@aronchick aronchick Apr 16, 2024

Choose a reason for hiding this comment

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

i think i'm ok as well if we autogenerate (only if not provided) and the token goes into a defined file somewhere. Not logs. This feels like best practice to me.

@frrist frrist force-pushed the frrist/mp-tf/run-bacalhau-as-bacalhau-user branch from b464bbf to 93b3427 Compare April 2, 2024 15:11
Base automatically changed from frrist/mp-tf/run-bacalhau-as-bacalhau-user to main April 2, 2024 15:25
@@ -0,0 +1,107 @@
# create the bacalhau user that will run the bacalhau process
packages:
- vim
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

${bacalhau_service_file}

# bacalhau install-script to install a custom bacalhau version
- path: /etc/install-bacalhau.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

/etc probably not the best place for this. /usr/local/sbin's the best place for binaries that need su,or /usr/local/bin if it is intended for wider use. If it's only used by the installer, then probably less of an issue.

${bacalhau_service_file}

# bacalhau install-script to install a custom bacalhau version
- path: /etc/install-bacalhau.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

if you change the other one (not compulsory) then change this one too.

@@ -74,7 +74,7 @@ locals {
bacalhau_env_vars = {
LOG_LEVEL = "debug"
BACALHAU_NODE_LOGGINGMODE = "default"
BACALHAU_DIR = "/data"
BACALHAU_DIR = "/bacalhau_repo"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is okay, but wonder if it might be better in /opt/bacalhau/* eventually ?

c.f. https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html

Copy link
Contributor

@rossjones rossjones left a comment

Choose a reason for hiding this comment

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

LGTM. Couple suggestions for potential directory changes, but nothing urgent.

@frrist frrist self-assigned this Apr 16, 2024
@frrist frrist force-pushed the frrist/mp-tf/support-tls branch from 4293be3 to ed997ea Compare May 8, 2024 22:10
@frrist frrist enabled auto-merge (rebase) May 8, 2024 22:11
@frrist frrist merged commit 536f99d into main May 8, 2024
13 checks passed
@frrist frrist deleted the frrist/mp-tf/support-tls branch May 8, 2024 22:25
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.

4 participants