Giter VIP home page Giter VIP logo

Comments (5)

rit001 avatar rit001 commented on June 6, 2024 1

OK, I think adding much of your reply into the readme.md would provide enough background for most people. I am guessing that anyone who finds your repo is looking for a starting point that they can then build on.

As it is a personal example I think the only changes I would suggest are

- document the password you have set
- remove the font change.

Those 2 changes would at least allow someone to build an iso with your example and then log in to it. The font change can become 'interesting' depending on the test environment - with your settings I end up with a 30x20 screen :(

from pxeless.

cloudymax avatar cloudymax commented on June 6, 2024

Thanks for pointing that out - looks like i do have a few issues in the README.

First:

I've corrected the example commands to be:

docker build -t iso-generator . && \
docker run -it --mount type=bind,source="$(pwd)",target=/app iso-generator \
image-create.sh -a -u user-data.example -n jammy

Second:

I added the -n option to my branch to allow you to specifiy an ubuntu code-name (like focal or jammy)

Here's the function that variable is used with:

# get the url and iso infor for the latest release
latest_release(){
        BASE_URL="https://releases.ubuntu.com/${CODE_NAME}/"
        log "🔎 Checking for latest ${CODE_NAME} release..."
        ISO_FILE_NAME=$(curl -sSL "${BASE_URL}" |grep -oP "ubuntu-.*-server-amd64.iso" |head -n 1)
        IMAGE_NAME=$(curl -sSL ${BASE_URL} |grep -o 'Ubuntu .* LTS .*)' |head -n 1)
        CURRENT_RELEASE=$(echo "${ISO_FILE_NAME}" | cut -f2 -d-)
        SHA_SUFFIX="${CURRENT_RELEASE}"
        log "✅ Latest release is ${CURRENT_RELEASE}"
}

# get the url and iso info for a daily release
daily_release(){
        BASE_URL="https://cdimage.ubuntu.com/ubuntu-server/${CODE_NAME}/daily-live/current"
        log "🔎 Checking for daily ${CODE_NAME} release..."
        ISO_FILE_NAME=$(curl -sSL "${BASE_URL}" |grep -oP "${CODE_NAME}-live-server-amd64.iso" |head -n 1)
        IMAGE_NAME=$(curl -sSL ${BASE_URL} |grep -o 'Ubuntu .* LTS .*)' |head -n 1)
        CURRENT_RELEASE=$(echo "${IMAGE_NAME}" | awk '{print $3}')
        SHA_SUFFIX="${CURRENT_RELEASE}"
        log "✅ Daily release is ${CURRENT_RELEASE}"
}

There is a short description in the help-text as well:

-n, --code-name         The Code Name of the Ubuntu release to download (focal, jammy etc...)

And here are some usage examples:

> docker run -it --mount type=bind,source="$(pwd)",target=/app iso-generator image-create.sh -a -u user-data.basic -n jammy

[2022-08-25 16:07:06] 📁 Created temporary working directory /tmp/tmp.ZPRPX2PF6F
[2022-08-25 16:07:06] 📁 Created temporary build directory /tmp/tmp.LefesDV388
[2022-08-25 16:07:06] 👶 Starting up...
[2022-08-25 16:07:06] 🔎 Checking for daily jammy release...
[2022-08-25 16:07:06] ✅ Daily release is 22.04.1
[2022-08-25 16:07:06] ✅ 22.04.1 is greater than 20.10. Not a legacy image.

> docker run -it --mount type=bind,source="$(pwd)",target=/app iso-generator image-create.sh -a -u user-data.basic -n focal
[2022-08-25 16:09:56] 📁 Created temporary working directory /tmp/tmp.gQe132NkQJ
[2022-08-25 16:09:56] 📁 Created temporary build directory /tmp/tmp.5CjZC2VPBw
[2022-08-25 16:09:56] 👶 Starting up...
[2022-08-25 16:09:56] 🔎 Checking for daily focal release...
[2022-08-25 16:09:57] ✅ Daily release is 20.04.5
[2022-08-25 16:09:57] ❗ 20.04.5 is lower than 20.10. Marking image as legacy.

from pxeless.

rit001 avatar rit001 commented on June 6, 2024

Thanks for the quick update to the examples. As a side note your example user-data.basic seems to be a very personal example.

from pxeless.

cloudymax avatar cloudymax commented on June 6, 2024

Yeah that's an accurate description, I wanted to add something that contained more variety of modules used than many other cloud init tutorials and ended up using a mildly sanitized version of my own homelab's config.

I'm not really sure how best to approach providing examples for this project since there's so many possibilities. I'm definitely open to feedback and suggestions in that regard.

There is a companion repo to this one that focuses more on using cloud-init to provision QEMU VMs and has some more examples, as well as some private templates I could clean up and provide if that would be helpful.

You can see some of that work here https://github.com/cloudymax/Scrap-Metal/blob/main/virtual-machines/user-data.sh though it is not documented enough for a release at this time.

My other thought was to simply link to a few other projects and blogs like this one from Puget systems that also cover the topic as an attempt to lessen my own responsibility for maintaining documentation.

from pxeless.

cloudymax avatar cloudymax commented on June 6, 2024

Thanks for the feedback, I'll scale back on the provided example cloud-init and update the documentation to point to resources with more advanced examples.

from pxeless.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.