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

Refactor rocky8 #201

Merged
merged 4 commits into from
Feb 1, 2024
Merged

Conversation

GR360RY
Copy link
Contributor

@GR360RY GR360RY commented Jan 31, 2024

Relates to #197

Remove reliance on make when building the Rocky 8 image.

@GR360RY
Copy link
Contributor Author

GR360RY commented Jan 31, 2024

@alexsander-souza , please check out the changes for rocky8. This is similar to what we did with centos7.
On the same note: we rely on make to remove output-rocky8 directory when cleaning up the build.
There is a better way to address it - use artifice post processor.

Do you ever use uncompressed qcow files to verify the build ?

ubuntu@maas-builder-01:~/upstream/packer-maas/rocky8$ file output-rocky8/packer-rocky8
output-rocky8/packer-rocky8: QEMU QCOW2 Image (v3), 4294967296 bytes

If not, this can be addressed with the following stanza:

  post-processors {
    post-processor "shell-local" {
      inline = [
        "SOURCE=rocky8",
        "OUTPUT=${var.filename}",
        "source ../scripts/fuse-nbd",
        "source ../scripts/fuse-tar-root"
      ]
      inline_shebang = "/bin/bash -e"
    }
    post-processor "artifice" {
      files = ["rocky8.tar.gz"]
    }
  }

Copy link
Contributor

@alexsander-souza alexsander-souza left a comment

Choose a reason for hiding this comment

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

+1

@alexsander-souza
Copy link
Contributor

No, we don't need the qcow image after create the tarball. You can update this PR with this change if you want.

@GR360RY GR360RY force-pushed the refactor_rocky_8 branch 3 times, most recently from 03af5f4 to 13c974a Compare February 1, 2024 07:32
@GR360RY
Copy link
Contributor Author

GR360RY commented Feb 1, 2024

@alexsander-souza, all looks good now. No reliance on make. We can run packer build . in rocky8 multiple times without cleaning up artifacts with make.

Changes summary:

  1. Run gzip with --force to override tar.gz if exists
  2. Remove output directory in shell-local post processor

artifice post processor is not removing artifacts. Use shell-local with rm -rf output-${source.name} instead.

@GR360RY
Copy link
Contributor Author

GR360RY commented Feb 1, 2024

@alexsander-souza , please merge/comment so I could move forward to the next distro. If possible, please also merge #200

@alexsander-souza alexsander-souza merged commit 5b9b16b into canonical:main Feb 1, 2024
1 check passed
@GR360RY GR360RY deleted the refactor_rocky_8 branch February 3, 2024 06:06
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.

2 participants