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

chore: refactor packer templates #221

Merged
merged 6 commits into from
May 14, 2022

Conversation

dduportal
Copy link
Contributor

@dduportal dduportal commented May 8, 2022

This change is a try to fix the packer template to anticipate for the upcoming new Windows server 2022 and Ubuntu 22.04 updates + fixes some non-functionnal items:

  • fix: Bump version constraint to allow using packer 1.8.x
  • chore: Cleanup leftovers from feat: add a first batch of infra tools #216
  • chore: Get rid of the cumbersome run-packer.sh script in favor of "raw" packer commands
  • chore: Split the big monolithic jenkins-agent.pkr.hcl file into smaller files that can be reused project-wide (following usual hashicorp HCL project conventions: variables file, locals file, etc.)
  • chore: Cleanup the Jenkinsfile_k8s / pod templaye / README
  • fix: allow separating OS versions
  • chore: rename scripts/ to provisioning/ to help newcomers mapping the concepts to Packer's documentation

It also bumps the packer plugins and start keeping track of them using updatecli: I hope that it would fix the recent azure plugin crash

@dduportal dduportal force-pushed the fix/packer-template branch 10 times, most recently from a003fa0 to 5a03c38 Compare May 8, 2022 13:19
@dduportal dduportal force-pushed the fix/packer-template branch 8 times, most recently from 9df5318 to d55d48d Compare May 11, 2022 17:39
@dduportal dduportal changed the title Fix/packer template chore: refactor packer templates May 11, 2022
@dduportal dduportal marked this pull request as ready for review May 11, 2022 18:26
@dduportal dduportal requested review from lemeurherve and timja May 11, 2022 18:26
Copy link
Member

@lemeurherve lemeurherve left a comment

Choose a reason for hiding this comment

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

Great job! 🎉

Jenkinsfile_k8s Outdated Show resolved Hide resolved
sh './run-packer.sh build'
),]) {
// Required if packer needs to be installed
sh 'command -v packer >/dev/null 2>&1 || bash ./install-packer.sh "${WORKSPACE}/.bin" "1.8.0"'
Copy link
Member

Choose a reason for hiding this comment

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

WDYT of a trackable version in an env var for packer here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I vote for, instead, installing packer in one of the images, as part of #198 (where it will be tracked instead)

build-jenkins-agent-ubuntu.pkr.hcl Outdated Show resolved Hide resolved
build-jenkins-agent-windows.pkr.hcl Outdated Show resolved Hide resolved
locals.pkr.hcl Outdated Show resolved Hide resolved
locals.pkr.hcl Outdated Show resolved Hide resolved
sources.pkr.hcl Outdated Show resolved Hide resolved
This was referenced May 13, 2022
dduportal and others added 3 commits May 14, 2022 10:20
- Support multiple OS versions
- Split HCL files to ease maintenance

Signed-off-by: Damien Duportal <[email protected]>
…azon,azure and docker plugins to last versions

Signed-off-by: Damien Duportal <[email protected]>
@dduportal dduportal force-pushed the fix/packer-template branch from 58b6fde to e5e3d1c Compare May 14, 2022 08:20
@dduportal
Copy link
Contributor Author

  • Applied code review feedbacks
  • Rebased + fixed conflicts

=> Ready to review, and merge if approved

Copy link
Member

@lemeurherve lemeurherve left a comment

Choose a reason for hiding this comment

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

🎉 🚢

@lemeurherve lemeurherve merged commit e92ed59 into jenkins-infra:main May 14, 2022
lemeurherve added a commit to lemeurherve/packer-images that referenced this pull request May 14, 2022
* chore(packer) add support of packer 1.8.x

Signed-off-by: Damien Duportal <[email protected]>

* fix(packer) cleanup references to former .auto.pkrvars.hcl

Signed-off-by: Damien Duportal <[email protected]>

* feat(windows) increase the disk size above the 127 Gb limit (Azure limit)

Signed-off-by: Damien Duportal <[email protected]>

* chore: cleanup + refactor packer templates

- Support multiple OS versions
- Split HCL files to ease maintenance

Signed-off-by: Damien Duportal <[email protected]>

* chore(packer,updatecli) track plugin version with updatecli + bump amazon,azure and docker plugins to last versions

Signed-off-by: Damien Duportal <[email protected]>

* Apply suggestions from code review

Co-authored-by: Hervé Le Meur <[email protected]>

Co-authored-by: Hervé Le Meur <[email protected]>
@dduportal dduportal deleted the fix/packer-template branch May 14, 2022 10:12
lemeurherve added a commit that referenced this pull request May 14, 2022
* fix: correct cygwin path

Added back grep sanity check
Rel: jenkins-infra/helpdesk#2873

* chocoInstall + packer + list cygwin bin folder

* replace ternary by if else

* comment on cygwin tools listing

* better function

* function later...

* comment out buggy function

* remove packer

* chore: refactor packer templates (#221)

* chore(packer) add support of packer 1.8.x

Signed-off-by: Damien Duportal <[email protected]>

* fix(packer) cleanup references to former .auto.pkrvars.hcl

Signed-off-by: Damien Duportal <[email protected]>

* feat(windows) increase the disk size above the 127 Gb limit (Azure limit)

Signed-off-by: Damien Duportal <[email protected]>

* chore: cleanup + refactor packer templates

- Support multiple OS versions
- Split HCL files to ease maintenance

Signed-off-by: Damien Duportal <[email protected]>

* chore(packer,updatecli) track plugin version with updatecli + bump amazon,azure and docker plugins to last versions

Signed-off-by: Damien Duportal <[email protected]>

* Apply suggestions from code review

Co-authored-by: Hervé Le Meur <[email protected]>

Co-authored-by: Hervé Le Meur <[email protected]>

* fix chocolatey updatecli  manifest

* replace echo by Write-Host

* Update provisioning/windows-provision.ps1

Co-authored-by: Damien Duportal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants