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

HIVE-28339: Dockerfile and GitHub action for hive-ci-jenkins image #5331

Closed
wants to merge 2 commits into from

Conversation

zabetak
Copy link
Contributor

@zabetak zabetak commented Jul 2, 2024

What changes were proposed in this pull request?

  1. Dockerfile for building the apache/hive-ci-jenkins image (to be used by http://ci.hive.apache.org/)
  2. GitHub action for building and deploying the image to https://hub.docker.com/repository/docker/apache/hive-ci-jenkins/ on demand
  3. Instructions/Suggestions for building, testing, and upgrading the Jenkins instance in CI.

Why are the changes needed?

  1. Upgrade the Jenkins CI instance to the latest version
  2. Host and maintain the Jenkins CI images under the apache/hive namespace
  3. Provide guidelines/reference points for future updates

Does this PR introduce any user-facing change?

No

Is the change a dependency upgrade?

No

How was this patch tested?

The image produced from the Dockerfile here is already running production.

  1. Followed roughly the steps described in the new README.md file for building and testing the image.
  2. Pushed the image to https://hub.docker.com/repository/docker/apache/hive-ci-jenkins with lts-jdk21 tag.
  3. Updated Kubernetes deployment for https://ci.hive.apache.org/ to use the apache/hive-ci-jenkins:lts-jdk21 image

@abstractdog
Copy link
Contributor

I can see that Zoltan's repo contains an entrypoint script: https://github.com/kgyrtkirk/hive-test-kube/blob/master/htk-jenkins/entrypoint
isn't that missing from here? I guess we want to track it together with the Dockerfile

thanks for this effort so far, I totally agree with this initiative to include hive's ci infra code to the main repo

@zabetak
Copy link
Contributor Author

zabetak commented Jul 17, 2024

@abstractdog The https://github.com/kgyrtkirk/hive-test-kube/blob/master/htk-jenkins/entrypoint does not appear necessary.

The JVM options are now passed using ENV JENKINS_JAVA_OPTS and the default configuration in jenkins_home is anyways overridden by the content of the persistent volume that is attached to the pod.

For the upgrade, we need to ensure that the current state and configurations in the persistent volume are not in conflict
with the new Jenkins version before pushing the new image to production.

1. Obtain a backup of the jenkins_home directory from the persistent volume.
Copy link
Member

Choose a reason for hiding this comment

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

these instructions work outside k8s; as it is I guess you can't launch a single job during the validation...
the right process should be:

  • copy k8s volume
  • create a new pod with the copied data
  • use that to check things out

instead of launching with docker: I think you should document that (or remove these instructions)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can test various aspects but indeed launching jobs or connecting to the K8 nodes will not work.

The process outlined above indeed makes sense but wasn't very comfortable doing that in the actual cluster cause I was afraid of potential side-effects. If a second fully-working Jenkins instance comes up running it may interfere with the main one.

Anyways given that very few people have access to the K8 cluster it may be better to remove these instructions altogether for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed upgrade instructions in 9870120

@kgyrtkirk
Copy link
Member

yes - it was a surprise to me as well that k8s doesn't support VOLUME-s; the default config copy was a courtesy to make it usable right away if it gets deployed at a new location

I think putting this into the main repo is not the best - as you will need to deploy it and push the image to see what happens...so you will at most will be committing to the repo as an after-tought....keeping a separate un-confined repo will make it easier to track what and when was changed - but I might be alone with this view...

@abstractdog
Copy link
Contributor

yes - it was a surprise to me as well that k8s doesn't support VOLUME-s; the default config copy was a courtesy to make it usable right away if it gets deployed at a new location

I think putting this into the main repo is not the best - as you will need to deploy it and push the image to see what happens...so you will at most will be committing to the repo as an after-tought....keeping a separate un-confined repo will make it easier to track what and when was changed - but I might be alone with this view...

I feel that keeping this image in the main repo is the way to go
how to manage the challenges that come with this approach is a different question, regarding which I have no idea now, honestly :)
this approach is not strictly "after-tought", only if it's proven to be impossible to test the Dockerfile changes in advance, I hope it's not the case, thinking about a github action to create and push an image with a custom tag from a PR like this (automatically or driven by a label)

@zabetak
Copy link
Contributor Author

zabetak commented Jul 17, 2024

I agree with Zoltan that a separate repo would be beneficial for tracking CI and product changes separately. However, I am willing to sacrifice this separation for facilitating the discovery and contributions to the CI part.

At the same time, I feel that the testability aspect for Jenkins changes is independent of where the code is hosted. Even if this code is hosted in another repo we would still need a way to prove that changes in the Jenkins image do not break production. This is definitely an area with lots of room for improvements.

Copy link

sonarcloud bot commented Jul 17, 2024

@zabetak
Copy link
Contributor Author

zabetak commented Jul 19, 2024

@abstractdog @kgyrtkirk Is there anything else apart from the repo debate holding off this PR? I want to get a feeling what is pending to finalize this work to see how to advance.

Copy link
Contributor

@okumin okumin left a comment

Choose a reason for hiding this comment

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

I confirmed docker build and docker run in README worked for me, and Jenkins was available on http://0.0.0.0:35000/.

Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Feel free to reach out on the [email protected] list if the patch is in need of reviews.

@github-actions github-actions bot added the stale label Sep 20, 2024
@github-actions github-actions bot closed this Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants