-
Notifications
You must be signed in to change notification settings - Fork 30
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
add flag to flatcar-install to only download the image file #248
Comments
Hi, Another suggestion would be to keep a local mirror which is up-to-date and access it via Hint for running flatcar-install in tinkerbell: #88 |
Hello folks! I’m an old sysadmin learning to write code. Am used to old unices/linuxen and only now getting up to speed with the modern distributions and the container / image world. Would love to tackle this issue with your help, because it kinda ticks all my boxes. i have wrestled with init/grub in the past to get systems booting, and this helps me learn and get familiar with modern stuff. While I will try to do it as fast as I can, that is not something that I entirely control as of now. What I can promise is perseverance and commitment. P.S. |
also, while i will keep this thread updated with what i have done, there must be some place where you folk gather and i can ask idiot level questions (on a general level)? because the more i read about flatcar, the more fascinated, I am getting and the more questions I have |
i realise this is not related to doing anything with the sdk and is pure bash manipulation. P.S. |
Hello folks, Just a little note to tell you what I learnt today
|
Hi, |
and this is why i should have not worked all day, just to compensate for the fact that I am beginning all over 😂 Thank you @pothos! I’ll look at the poseidon repo script too. maybe that’ll help me more :) will keep updating progress or asking for help here :) |
Had to stop work abruptly today. Have a death in the family. Trying to figure out how to send my mom over to another state. |
They have a slightly different purpose, and I just wanted to state that it exists and it may be useful to compare the approach. |
back at work today. @pothos once again, thank you for showing me the script. and yes i understood your intent as soon as I ran it. will try to understand it and adapt what i learn here. |
Log for 2021-03-02 Aim
once I get that done and hopefully can parse scripts better in my head (as i read and look this up daily), the idea then is to
What got done today
Blockers
above all, this was fun :) p.s. ooh today’s work is at https://github.com/jasonbraganza/init/blob/init-2021-03-01/bin/flatcar-install |
What got done today
Blockers
i’m using this line https://github.com/jasonbraganza/init/blob/9c0dd0c8c35996309e3f3c024369f5c25b6becfc/bin/flatcar-install#L414 to try to verify the file. now i think I need help. @pothos, @marga-kinvolk and other kind folk, would appreciate whatever guidance you have to give |
What got done today
Would request you, please have a look see at https://github.com/jasonbraganza/init/blob/849250aa0e351d61dd472b51af5236305963a95e/bin/flatcar-install#L346 ? |
Hi, P.S.: For others, here the diff: flatcar/init@flatcar-master...jasonbraganza:init-2021-03-01 |
Hi Jason, I also took a look. I'm sharing some first impression comments. You're calling the function directly from the argument parsing, this means that the parameters might not all be processed when that function is called. This is why all the other options just set variables and then the script does one thing or the other depending on those variables. Once you've moved to setting a variable instead of calling the function directly, you can put the function down with the other functions. And then you should add code that calls the function when that flag is set together with the rest of the main part of the script. Also, as Kai says, the intention of this change was to re-use the existing code in the |
@pothos, I was a little confused about that part of the key and did not know if it was a valid key or not. will work at using the embedded key. |
Will be reading up on bash today. |
just putting in a note to say i spent until yesterday learning bash. not well today. |
alright, i think i now know enough bash to parse this file intelligently and ask for advice. Here’s my understanding of the script. and then my plea for help. in my mind the script’s divided into three main parts.
i see two ways of attacking this Ii set a variable, say download to true.
or IIi set a variable, say download to true.
am in favour of and slowly plugging away at the second method because that kinda sounds more elegant in my head but i could also be completely ragingly wrong :) please advise! |
method i makes more sense. the flow would be like
|
As far as I can see, there's only one sanity check that needs to be modified (the one that verifies that a device was selected or that the write to smallest flag was passed). All the others can just remain as they are. The approach should be:
|
gosh darn it! I started that way and decided to skip the entire block 😂 here’s where i have ended up.
Blockeri don’t understand what this line does. (or rather how it does it)
i understand it is finishing up the function and then it somehow passes the output out to the write to disk function? my code is here - https://github.com/jasonbraganza/init/blob/mjb-adapt-init-2/bin/flatcar-install |
also @marga-kinvolk and @pothos, just wanted to say thank you, for pushing me along :) |
i think i am done. once i have a successful update, will ask you folk for further advice and direction. |
curious question, do i get rate limited? maybe that’s why the download is slow. @marga-kinvolk, @pothos please have a look see and tell me if i can raise a pr? |
Hi, There is no rate limit, not sure what's going on, might be a cold cache. |
@pothos that additional trap is to release the trap set earlier. without it bash hiccups a bit, which is why i put it in. |
Current situation
I want to be able to package flatcar-install and a specific version of the image (e.g. https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_image.bin.bz2) in a docker container so it can be easily installed by a tinkerbell workflow action in a air-gap environment.
Impact
flatcar-master/bin/flatcar-install need to be changed in a backwards compatible way.
Ideal future situation
add a switch to flatcar-install that only downloads the image and exits. for example with:
Or do not even have an argument, just download the file to the current directory, e.g.:
And a script of mine can look for the actual filename and later pass it to
flatcar-install -f
.Then later I can install it with:
Having this flag is easier than implementing the whole download/verification logic myself; I can just use something like
ADD https://github.com/flatcar-linux/init/blob/build-1688.4.0/bin/flatcar-install
in my Dockerfile. What do you think?The text was updated successfully, but these errors were encountered: