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

ci: fix docker #1444

Merged
merged 4 commits into from
Mar 16, 2024
Merged

ci: fix docker #1444

merged 4 commits into from
Mar 16, 2024

Conversation

neo773
Copy link
Contributor

@neo773 neo773 commented Mar 15, 2024

This sets the tags explicitly using raw values

Issue Reference(s):
Fixes #1433

/claim #1433

Summary by CodeRabbit

  • New Features
    • Improved CI workflow to automate assigning the application version and enhance Docker image tagging logic.
  • Refactor
    • Streamlined the build process by transitioning from Rust to Ubuntu, simplifying installation procedures.

@algora-pbc algora-pbc bot mentioned this pull request Mar 15, 2024
Copy link
Contributor

coderabbitai bot commented Mar 15, 2024

Walkthrough

The update focuses on refining the Docker CI process and transitioning the Dockerfile from a Rust-based build to a simpler setup using Ubuntu and curl. It ensures the Docker images are correctly tagged with the APP_VERSION derived from a previous step in the CI workflow, addressing versioning issues and aligning with the latest software installation guidelines.

Changes

File Change Summary
.github/.../ci.yml Added APP_VERSION env var and updated Docker tagging logic
Dockerfile Shifted from Rust-based build to Ubuntu with installation via curl

Assessment against linked issues

Objective Addressed Explanation
Install latest version of tailcall using curl (#1433)
Stop starting the server in Dockerfile (#1433)
Fix CI versioning, set versions correctly instead of using "main" (#1433) The addition of APP_VERSION ensures that Docker images are tagged with specific versions.
Update latest version pointer to v0.18.0 (#1433) The changes suggest versioning is addressed, but it's unclear if "latest" now points to v0.18.0.

🐰✨
A hop, a skip, in Docker's embrace,
From Rust's tight grip to Ubuntu's grace.
With curl in hand, we fetch, we weave,
Our versions tagged, in CI we believe.
No longer starting servers in the night,
Our containers light, our builds just right.
🚀🐇

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>.
    • Generate unit-tests 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 tests 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 tests.
    • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@github-actions github-actions bot added type: docs Related to documentation and information. type: fix Iterations on existing features or infrastructure. labels Mar 15, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 78460e8 and f8dab33.
Files selected for processing (2)
  • .github/workflows/ci.yml (2 hunks)
  • Dockerfile (1 hunks)
Additional comments: 2
.github/workflows/ci.yml (2)
  • 440-440: Ensure that the APP_VERSION environment variable is correctly derived from the draft_release job's output. This is crucial for consistent versioning across Docker images and other artifacts.
  • 465-467: The Docker image tagging strategy now includes dynamic versioning based on APP_VERSION and a latest tag conditional on the version not ending with -SNAPSHOT. Verify that this logic correctly reflects the intended versioning and publishing strategy, especially in scenarios where pre-release or snapshot versions are involved.

Dockerfile Outdated Show resolved Hide resolved
Copy link
Contributor

@ezhil56x ezhil56x left a comment

Choose a reason for hiding this comment

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

Change PR title to ci: fix docker for the checks to pass

@neo773 neo773 changed the title CI: fix docker ci: fix docker Mar 15, 2024
Dockerfile Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f8dab33 and abdbc8a.
Files selected for processing (1)
  • Dockerfile (1 hunks)

Dockerfile Outdated Show resolved Hide resolved
@amitksingh1490
Copy link
Collaborator

@neo773 can you send a screen recording where you have tested this

@tusharmath
Copy link
Contributor

Could you please provide some evidence that it's working, @neo773?

@amitksingh1490
Copy link
Collaborator

amitksingh1490 commented Mar 16, 2024

@neo773 I am not able to build this docker file

ERROR [3/3] RUN curl -sSL https://raw.githubusercontent.com/tailcallhq/tailcall/master/install.sh | bash -s                                              2.7s
------
 > [3/3] RUN curl -sSL https://raw.githubusercontent.com/tailcallhq/tailcall/master/install.sh | bash -s:
1.366 bash: line 11: jq: command not found
------
Dockerfile:3
--------------------
   1 |     FROM ubuntu:latest
   2 |     RUN apt-get update && apt-get install -y curl
   3 | >>> RUN curl -sSL https://raw.githubusercontent.com/tailcallhq/tailcall/master/install.sh | bash -s
   4 |     ENV PATH="${PATH}:~/.tailcall/bin"
   5 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c curl -sSL https://raw.githubusercontent.com/tailcallhq/tailcall/master/install.sh | bash -s" did not complete successfully: exit code: 127

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 42a867c and b9d1924.
Files selected for processing (2)
  • .github/workflows/ci.yml (2 hunks)
  • Dockerfile (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yml

@amitksingh1490 amitksingh1490 enabled auto-merge (squash) March 16, 2024 13:46
@amitksingh1490 amitksingh1490 merged commit 331d1fc into tailcallhq:main Mar 16, 2024
22 checks passed
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 3484192 and c46d953.
Files selected for processing (2)
  • .github/workflows/ci.yml (2 hunks)
  • Dockerfile (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yml


ENV TAILCALL_LOG_LEVEL=error
CMD ["/bin/tailcall", "start", "jsonplaceholder.graphql"]
FROM ubuntu:latest
Copy link
Contributor

Choose a reason for hiding this comment

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

Given the previous comment about pinning the Ubuntu version, it's advisable to specify a particular version of Ubuntu instead of using latest. This ensures consistent and predictable builds.

- FROM ubuntu:latest
+ FROM ubuntu:20.04

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
FROM ubuntu:latest
FROM ubuntu:20.04

@@ -37,0 +1,4 @@
FROM ubuntu:latest
RUN apt-get update && apt-get install -y curl jq
Copy link
Contributor

Choose a reason for hiding this comment

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

The addition of jq addresses the build error mentioned in the PR comments. However, it's good practice to clean up the apt cache by adding && rm -rf /var/lib/apt/lists/* at the end of the RUN command to reduce the image size.

- RUN apt-get update && apt-get install -y curl jq
+ RUN apt-get update && apt-get install -y curl jq && rm -rf /var/lib/apt/lists/*

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
RUN apt-get update && apt-get install -y curl jq
RUN apt-get update && apt-get install -y curl jq && rm -rf /var/lib/apt/lists/*

@@ -37,0 +1,4 @@
FROM ubuntu:latest
RUN apt-get update && apt-get install -y curl jq
RUN curl -sSL https://raw.githubusercontent.com/tailcallhq/tailcall/master/install.sh | bash -s
Copy link
Contributor

Choose a reason for hiding this comment

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

Considering the security concerns raised in the previous comments, it's crucial to verify the integrity of the script fetched from the internet. If possible, download the script, verify its checksum, and then execute it. This step is essential to ensure the security of the build process.

FROM ubuntu:latest
RUN apt-get update && apt-get install -y curl jq
RUN curl -sSL https://raw.githubusercontent.com/tailcallhq/tailcall/master/install.sh | bash -s
ENV PATH="${PATH}:~/.tailcall/bin"
Copy link
Contributor

Choose a reason for hiding this comment

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

The use of ~ in the PATH environment variable might not resolve correctly, as mentioned in the previous comments. It's better to use the absolute path to ensure that the tailcall binary is correctly added to PATH.

- ENV PATH="${PATH}:~/.tailcall/bin"
+ ENV PATH="${PATH}:/root/.tailcall/bin"

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
ENV PATH="${PATH}:~/.tailcall/bin"
ENV PATH="${PATH}:/root/.tailcall/bin"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 Bounty claim type: docs Related to documentation and information. type: fix Iterations on existing features or infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: docker CI
5 participants