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

[docs] Explain the builtin commands and the separating script for script run stage #5127

Merged
merged 8 commits into from
Sep 5, 2024

Conversation

ffjlabo
Copy link
Member

@ffjlabo ffjlabo commented Aug 9, 2024

What this PR does / why we need it:

as title

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

… stage

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Copy link

codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 22.84%. Comparing base (58bf4ff) to head (48022da).
Report is 50 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5127      +/-   ##
==========================================
+ Coverage   22.80%   22.84%   +0.04%     
==========================================
  Files         412      420       +8     
  Lines       43827    45247    +1420     
==========================================
+ Hits         9996    10338     +342     
- Misses      33044    34114    +1070     
- Partials      787      795       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- ssh
- jq
- curl
- and the builtin commands installed in the base image.
Copy link
Member

Choose a reason for hiding this comment

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

Users can also use piped installed tools such as terraform, kubectl, helm, kustomize, etc 👀

Copy link
Member Author

Choose a reason for hiding this comment

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

@khanhtc1202
Thank you for the comment.
I think it might be unexpected usage for these tools.
WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I don't really get your point. Could you explain it 🙏

Copy link
Member Author

Choose a reason for hiding this comment

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

📝 Discussed about it in person. I agree that users can use the commands installed for the piped.

  • we can use them on the script run stage
  • but this may change in the future

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed on 48d7819

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @khanhtc1202 .
It's okay to mention that some tools may be available under PIPED_TOOLS_DIR.
But I think we also have to mention that the tools can be absent sometimes.

Copy link
Member Author

Choose a reason for hiding this comment

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

@khanhtc1202 @Warashi

So, the binaries are sometimes absent, such as when the SCRIPT_RUN stage is the first stage of the pipeline and the binaries are not installed yet.

I forgot it. So I think we should not explain it.

It might be confusing for users who use SCRIPT_RUN that the command does not exist until the first deployment is executed.
If the piped administrator and the app administrator are different, I don't think there is a way for the app administrator to check the dir.

WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

The app administrator can use the SCRIPT_RUN stage, such as executing ls, to check whether the commands exist.
But I think it's nonsense to check whether the commands exist. If the administrator has to use a command, they should install it in the SCRIPT_RUN stage or ask the piped admin to use a custom container image containing the command.

I think it's okay to mention some tools are sometimes available under PIPED_TOOLS_DIR because it's a fact.
On the other hand, users must use those tools carefully, and we must explain why users must pay attention.

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 tried adding it anyway. bfb1765

Copy link
Member Author

Choose a reason for hiding this comment

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

Plz check it 🙏 @Warashi @khanhtc1202

Copy link
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

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

Great improvement 👍
I left some nits

Comment on lines 68 to 70
labels:
env: example
team: product
Copy link
Member

Choose a reason for hiding this comment

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

[nits] I think labels section is not necessary for the explanation.


The public piped image available in PipeCD main repo (ref: [Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/cmd/piped/Dockerfile)) is based on [alpine](https://hub.docker.com/_/alpine/) and only has a few UNIX command available (ref: [piped-base Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/tool/piped-base/Dockerfile)).

If you want to use your commands, you can:
Copy link
Member

Choose a reason for hiding this comment

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

[nits] I wanna clarify whether the options are isolated or combined.

e.g.

Suggested change
If you want to use your commands, you can:
If you want to use your commands, follow these steps:

└── script.sh
```

## Builtin command
Copy link
Member

Choose a reason for hiding this comment

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

[nits]

Suggested change
## Builtin command
## Builtin commands

- curl
- and the builtin commands installed in the base image.

The public piped image available in PipeCD main repo (ref: [Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/cmd/piped/Dockerfile)) is based on [alpine](https://hub.docker.com/_/alpine/) and only has a few UNIX command available (ref: [piped-base Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/tool/piped-base/Dockerfile)).
Copy link
Member

Choose a reason for hiding this comment

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

[nits]

Suggested change
The public piped image available in PipeCD main repo (ref: [Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/cmd/piped/Dockerfile)) is based on [alpine](https://hub.docker.com/_/alpine/) and only has a few UNIX command available (ref: [piped-base Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/tool/piped-base/Dockerfile)).
The public piped image available in PipeCD main repo (ref: [Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/cmd/piped/Dockerfile)) is based on [alpine](https://hub.docker.com/_/alpine/) and only has a few UNIX commands available (ref: [piped-base Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/tool/piped-base/Dockerfile)).

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
@ffjlabo ffjlabo force-pushed the fix-docs-for-script-run branch from 105b378 to c502a27 Compare August 13, 2024 02:09
@ffjlabo
Copy link
Member Author

ffjlabo commented Aug 13, 2024

@t-kikuc Thank you for the comment 🙏 I fixed them.

  • fix description for the usecase 3ab416e
    • clarified the options as isolated ones.
    • removed the one that is not recommended
  • remove labels ed4f0b0
  • wrong spell c502a27

@ffjlabo ffjlabo requested a review from t-kikuc August 13, 2024 02:13
t-kikuc
t-kikuc previously approved these changes Aug 13, 2024
For example, If you are using the container platform and the offcial piped container image, you can use the command below.
- git
- ssh
- jq
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't install jq in 0.46.x images, because it's installed at 0.48.0 release
#5009

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed on dc78b67

For example, If you are using the container platform and the offcial piped container image, you can use the command below.
- git
- ssh
- jq
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't install jq in 0.47.x images, because it's installed at 0.48.0 release
#5009

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed on dc78b67

@khanhtc1202
Copy link
Member

@ffjlabo Could you check this 👀

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Warashi
Warashi previously approved these changes Sep 4, 2024
Copy link
Contributor

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

LGTM

@t-kikuc
Copy link
Member

t-kikuc commented Sep 5, 2024

@khanhtc1202 Would you check again?

Comment on lines 87 to 96
- git
- ssh
- jq
- curl
- kubectl, helm, kustomize, terraform stored in $PIPED_TOOL_DIR
- Be careful. These tools are sometimes absent because they are installed when the first deployment has been done using each tool. Please check $PIPED_TOOL_DIR before you use them.
- Binaries can be specified as "kubectl-${version}" or "kubectl".
- If no version is specified on the piped config or app.pipecd.yaml, both the ones with and without default version suffix will be installed.
- Please check the [code](https://github.com/pipe-cd/pipecd/blob/master/pkg/app/piped/toolregistry/install.go#L28C1-L33C2) about the default versions.
- and the builtin commands installed in the base image.
Copy link
Member

@khanhtc1202 khanhtc1202 Sep 5, 2024

Choose a reason for hiding this comment

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

Suggested change
- git
- ssh
- jq
- curl
- kubectl, helm, kustomize, terraform stored in $PIPED_TOOL_DIR
- Be careful. These tools are sometimes absent because they are installed when the first deployment has been done using each tool. Please check $PIPED_TOOL_DIR before you use them.
- Binaries can be specified as "kubectl-${version}" or "kubectl".
- If no version is specified on the piped config or app.pipecd.yaml, both the ones with and without default version suffix will be installed.
- Please check the [code](https://github.com/pipe-cd/pipecd/blob/master/pkg/app/piped/toolregistry/install.go#L28C1-L33C2) about the default versions.
- and the builtin commands installed in the base image.
- git
- ssh
- jq
- curl
- commands installed by piped in $PIPED_TOOL_DIR (check at runtime)
- built-in commands installed in the base image

How about this? @ffjlabo

Copy link
Member Author

Choose a reason for hiding this comment

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

@khanhtc1202
I think we also have to mention that the tools can be absent sometimes.
WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

That is why I added the note (check at runtime). I think it would be better not to confuse users by showing too much explanation 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I agree with your point.
I will fix it👌

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed 48022da

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
@ffjlabo ffjlabo requested review from Warashi and t-kikuc September 5, 2024 09:21
Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

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

Thank you 💯

@khanhtc1202 khanhtc1202 merged commit e7c40a0 into master Sep 5, 2024
17 checks passed
@khanhtc1202 khanhtc1202 deleted the fix-docs-for-script-run branch September 5, 2024 15:26
@github-actions github-actions bot mentioned this pull request Sep 10, 2024
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