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

CRAYSAT-1912: Get K8s version from node-images #273

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

haasken-hpe
Copy link
Contributor

Summary and Scope

Update the cray-sat image build process to get the Kubernetes version from its new location in the node-images repository instead of the old version in the deprecated metal-provision repository.

This is more involved than just changing the repository URL and path in the docker_scripts/config-docker-sat.sh script because the node-images repository is private in GitHub, but metal-provision was public. Thus we need to authenticate to GitHub when cloning this repository. This is best achieved through a git command in the Jenkinsfile.

In order to continue supporting local builds, add a target to the Makefile that clones the node-images repository if it does not already exist. Use the git protocol instead of https to allow it to use the user's configured SSH keypair to authenticate when cloning the repo.

In either case, the node-images repository gets bind-mounted during the RUN command, so that it can be accessed by the config-docker-sat.sh script.

Issues and Related PRs

Testing

Tested on:

  • Local development environment
  • Jenkins

Test description:

Built the image locally using make image. Then ran the container and executed kubectl version to verify the version of the kubectl client that was installed.

Pushed to Jenkins and verified that the Jenkins pipeline worked.

Risks and Mitigations

Pull Request Checklist

  • Version number(s) incremented, if applicable
  • Copyrights updated
  • License file intact
  • Target branch correct
  • CHANGELOG.md updated
  • Testing is appropriate and complete, if applicable
  • HPC Product Announcement prepared, if applicable

Update the cray-sat image build process to get the Kubernetes version
from its new location in the node-images repository instead of the old
version in the deprecated metal-provision repository.

This is more involved than just changing the repository URL and path in
the `docker_scripts/config-docker-sat.sh` script because the node-images
repository is private in GitHub, but metal-provision was public. Thus we
need to authenticate to GitHub when cloning this repository. This is
best achieved through a `git` command in the Jenkinsfile.

In order to continue supporting local builds, add a target to the
`Makefile` that clones the node-images repository if it does not already
exist. Use the `git` protocol instead of `https` to allow it to use the
user's configured SSH keypair to authenticate when cloning the repo.

In either case, the node-images repository gets bind-mounted during the
`RUN` command, so that it can be accessed by the `config-docker-sat.sh`
script.

Test Description:
Built the image locally using `make image`. Then ran the container and
executed `kubectl version` to verify the version of the `kubectl` client
that was installed.

Pushed to Jenkins and verified that the Jenkins pipeline worked.
Copy link
Contributor

@shivaprasad-metimath shivaprasad-metimath left a comment

Choose a reason for hiding this comment

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

looks good

@haasken-hpe
Copy link
Contributor Author

Before merge, we should test the few important places where we use kubectl. In order of importance:

  • Branch to commit resolution in sat bootprep
  • Image customization in sat bootprep

@shivaprasad-metimath
Copy link
Contributor

@annapoorna-s-alt testing results:
https://gist.github.com/annapoorna-s-alt/45736c9032a583c3bf5dc972acb60e7e

The testing looks good, hence proceeding with merging the PR

@shivaprasad-metimath shivaprasad-metimath merged commit 040f41c into main Oct 10, 2024
3 checks passed
@shivaprasad-metimath shivaprasad-metimath deleted the CRAYSAT-1912-update-kubectl branch October 10, 2024 14:07
shivaprasad-metimath pushed a commit that referenced this pull request Oct 10, 2024
Update the cray-sat image build process to get the Kubernetes version
from its new location in the node-images repository instead of the old
version in the deprecated metal-provision repository.

This is more involved than just changing the repository URL and path in
the `docker_scripts/config-docker-sat.sh` script because the node-images
repository is private in GitHub, but metal-provision was public. Thus we
need to authenticate to GitHub when cloning this repository. This is
best achieved through a `git` command in the Jenkinsfile.

In order to continue supporting local builds, add a target to the
`Makefile` that clones the node-images repository if it does not already
exist. Use the `git` protocol instead of `https` to allow it to use the
user's configured SSH keypair to authenticate when cloning the repo.

In either case, the node-images repository gets bind-mounted during the
`RUN` command, so that it can be accessed by the `config-docker-sat.sh`
script.

Test Description:
Built the image locally using `make image`. Then ran the container and
executed `kubectl version` to verify the version of the `kubectl` client
that was installed.

Pushed to Jenkins and verified that the Jenkins pipeline worked.

(cherry picked from commit 040f41c)
shivaprasad-metimath added a commit that referenced this pull request Oct 10, 2024
Update the cray-sat image build process to get the Kubernetes version
from its new location in the node-images repository instead of the old
version in the deprecated metal-provision repository.

This is more involved than just changing the repository URL and path in
the `docker_scripts/config-docker-sat.sh` script because the node-images
repository is private in GitHub, but metal-provision was public. Thus we
need to authenticate to GitHub when cloning this repository. This is
best achieved through a `git` command in the Jenkinsfile.

In order to continue supporting local builds, add a target to the
`Makefile` that clones the node-images repository if it does not already
exist. Use the `git` protocol instead of `https` to allow it to use the
user's configured SSH keypair to authenticate when cloning the repo.

In either case, the node-images repository gets bind-mounted during the
`RUN` command, so that it can be accessed by the `config-docker-sat.sh`
script.

Test Description:
Built the image locally using `make image`. Then ran the container and
executed `kubectl version` to verify the version of the `kubectl` client
that was installed.

Pushed to Jenkins and verified that the Jenkins pipeline worked.

(cherry picked from commit 040f41c)

Co-authored-by: Ryan Haasken <[email protected]>
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