-
Notifications
You must be signed in to change notification settings - Fork 263
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
GitHub Action for kn #1066
Comments
I wonder whether we need a dedicated action or if our container image for kn that could be used as an action would be good enough ? (saying that with being a github action noob ) |
I think the challenge with GitHub Actions right now is that there isn't the perfect pattern for including CLIs as part of a build. In a lot of cases, actions have been developed to install CLIs on the host, which is not the most ideal pattern. And the challenge with using an image (i.e. |
thanks @navidshaikh , I have a early version of the action https://github.com/kameshsampath/kn-service-action and an example using it https://github.com/kameshsampath/kn-service-action-example. Right now tested only on OpenShift |
@kameshsampath thanks a lot @kameshsampath ! Eventually we could move to a |
I recently added a step in a GitHub Actions workflow to install kn: - name: Setup kn
run: |-
echo "Downloading kn $KN_VERSION to $KN_INSTALL_PATH..."
sudo wget --quiet -O $KN_INSTALL_PATH "https://github.com/knative/client/releases/download/$KN_VERSION/kn-linux-amd64"
sudo chmod +x $KN_INSTALL_PATH
echo "Installed kn $KN_VERSION" GitHub Actions has been an area of interest for me lately, and I wanted to try making an action of my own, so I thought this would be a fun project to do. I planned to start it this weekend, but decided to search and found this issue first.
I think this is why the pattern so far is to have JavaScript actions that mutate the host. That way, CLIs can be installed and used by steps further down in the workflow's job. Docker actions run in a separate container (which has read only access to the host machine's file system), so they can't be used to install CLIs on the host. Docker actions can use CLI tools though, as long as they accept everything they need in the parameters of the action for the CLI tool to do what it needs to do. Google maintains an action (https://github.com/google-github-actions/setup-gcloud.) for setting up gcloud so that it's available on the host machine for future steps in the job. They also maintain some actions that are self-contained (like https://github.com/google-github-actions/deploy-cloudrun) and used for specific tasks. This self-contained example doesn't use Knative could create actions with this style as inspiration too. We could have a |
I did some more reading on JavaScript vs. Docker actions and I read that Docker actions can actually mutate the host file system too. I was wrong about that before. I took a stab at creating I made it as a JavaScript action, taking inspiration from the setup-gcloud action from Google. It doesn't have a build pipeline though right now. I just put it in It skips the install if it's already installed and errors out if users specify something invalid: @kameshsampath I'm interested what your thoughts are on it. I do like your action for deploying services because it is self contained. |
@mattwelke - the biggest adv I see with Dockerfile based approach is that you dont need to be JS expert :) and enables people w/o JS knowledge to collaborate easily. But I do feel the native JS actions do have some advantages but never tried |
After talking on Slack, we decided it would be worth looking more into Docker actions for all actions, including setting up kn. I will look more into them before continuing with this and collaborating. Another goal is to use the existing kn Docker image as is, as the Docker action, or with the refactorong needed to use it both as it's used right now and as a Docker action. |
This issue is stale because it has been open for 90 days with no |
Is there still interest in this feature, or can we close this issue ? (asking because it went stale) |
@danielhelfand we have created an action https://github.com/redhat-actions/kn-service-manager to manage knative services, but knative should be installed in your kubernetes cluster to work with this action. May be this action can partially fulfill your requirement. P.S. Initial work is done by @kameshsampath (he has already mentioned that repos earlier in comments) we have tried to add some other features to make it more usable. |
This issue is stale because it has been open for 90 days with no |
/remove-lifecycle stale |
@mattwelke Based on your comment:
OpenShift Tools Installer action can install |
@kameshsampath @mattwelke If you don't mind I'm closing this issue as there is a good, fully-featured implementation provided by the OpenShift Tools installer (which despite the name also includes vanilla non-openshift tools like kubectl or kn) that is actively maintained. For the near future, I don't think we have the people to work on our own GitHub action. It's not so much about the initial implementation, more about the constant maintenance effort. This might change when we offer Kn distributions that come included with various plugins. Feel free to reopen the issue if I'm wrong. |
One caveat though is, that the OpenShift Tools Installer references the Red Hat productized version of kn (that include some plugins and is two minor versions behind the upstream version). @divyansh42 , I guess there are no plans to add the possibility to download upstream binaries ? |
@rhuss It can also install upstream binaries that are present here https://github.com/knative/client/releases |
Cool, thanks ! That's awesome and really helpful. |
* [release-v1.2.0] Add kn-plugin-func v0.24.0 * Update vendor dir
Feature request
It would be helpful for developers using GitHub Actions to have an easy way to use
kn
. Wondering if there has been any discussion around supporting an official GitHub Action and making it available through the GitHub Actions Marketplace.Creating a GitHub Action docs: https://docs.github.com/en/free-pro-team@latest/actions/creating-actions
Use case
For developers working with GitHub Actions for CI/CD, having an action that allows users to specify a specific version of
kn
to use and include in a build would help with automation around working with Knative.UI Example
N/A
The text was updated successfully, but these errors were encountered: