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

Add device connector to provision laptops with 24.04 using image-deploy.sh [OEX86-359] #304

Merged
merged 9 commits into from
Aug 16, 2024

Conversation

Artur-at-work
Copy link
Contributor

@Artur-at-work Artur-at-work commented Jul 9, 2024

Description

  • Add device-connector oem_autoinstall which can be used to provision laptops with Ubuntu 24.04
  • Add image-deploy.shscript which is used by oem-swe-x86 team to deploy OEM images starting from 24.04 (no stock Ubuntu). It was adapted for agent environment and relies on agent to download the ISO.

Resolved issues

Documentation

  • .github/CODEOWNERS was updated to assign ownership of image-deploy.sh to oem-swe-x86
  • device-connector-types.rst added oem_autoinstall and provision_data keys for it

Tests

  • Run "shellcheck image-deploy.sh"

  • Test with agent:

  1. Run agent locally with new device connector in testflinger-agent.conf:
    provision_command: testflinger-device-connector oem_autoinstall provision -c /home/artur/testflinger/agent/default.yaml testflinger.json
  2. Add default.yaml with device_ip of laptop
  3. Submit the job with attachments: user-data, authorization_keys, jenkins-token.txt
    Provisioned HP and Dell successfully:
    https://testflinger.canonical.com/jobs/7ce8e9b6-ff07-4f9a-b2aa-8cad7fdcbba8
    https://testflinger.canonical.com/jobs/cccb263e-7ebf-4f1f-8d3d-eb34fe0e41fa

@Artur-at-work
Copy link
Contributor Author

/canonical/self-hosted-runners/run-workflows d573c9e

@Artur-at-work Artur-at-work force-pushed the main branch 2 times, most recently from 1cd08d1 to ef133e6 Compare July 10, 2024 13:23
@Artur-at-work Artur-at-work requested a review from plars July 16, 2024 07:12
@Artur-at-work
Copy link
Contributor Author

hello @plars ,
Could you help to review this please?
As I understand, Cert. team is going to develop device connector for 24.04 oemscript provisioning and requires image-deploy.sh script for it.

@plars
Copy link
Collaborator

plars commented Jul 17, 2024

Hi @Artur-at-work - thanks for bringing this to my attention. Can you give me some more information about this? I know that we have 3 oemscript device connectors already - one for each of HP, Lenovo, and Dell oem systems. Will the 24.04 oem images work with the existing device connectors? If not, then will this new script also work for provisioning oem images prior to 24.04?

@Artur-at-work
Copy link
Contributor Author

No, 24.04 oem images won't work with the old script/connectors.
No, new script won't work with the older images

FYI, the ticket I saw related to device connector: https://warthogs.atlassian.net/browse/CERTTF-352

@plars
Copy link
Collaborator

plars commented Jul 18, 2024

@Artur-at-work So just to be clear, if a system is deployed with the previous oemscript using 20.04 or 22.04 oem images, is it possible to deploy a 24.04 image with this new image-deploy.sh on the same system, and then later use the previous script to deploy a 22.04 or 20.04 image on that same system? Or do we need separate systems for deploy either ONLY 24.04, or ONLY older images?

Have you been able to test whether deploying both older and newer images works on the same system? If we have a system in the lab where this is known to work, it would make a good one to test with.

@Artur-at-work
Copy link
Contributor Author

@plars, sure, feel free if any questions.

"if a system is deployed with the previous oemscript using 20.04 or 22.04 oem images, is it possible to deploy a 24.04 image with this new image-deploy.sh on the same system" - Yes.
"and then later use the previous script to deploy a 22.04 or 20.04 image on that same system?" - No. 22.04 was relying on ubuntu-recovery and dell-recovery, but it's not available in 24.04. So we can't deploy 22.04 on 24.04 no matter with old or new script.

"Or do we need separate systems for deploy either ONLY 24.04, or ONLY older images?" - Yes. Since 24.04 platform can only re-deploy 24.04, we'll need a separate platform to keep provisioning 22.04.

Yes, I had DUT with 22.04 and ran image-deploy.sh from remote machine to install 24.04 on DUT successfully. Would you like to have access?

Few more things:

  • In 24.04 we use only one image for all vendors, because we don't have ubuntu/dell-recovery.
  • platforms with 22.04 were formatted with 5.7GB recovery partition. When 24.04 deployed next, it will keep using 5.7GB recovery partition. In long term when ISO size will grow above 5.7GB, it will fail to copy ISO contents into the recovery partition and fail the redeployment. At the moment, I manually plug USB with script to format storage and create 12GB reset partition, then run the image-deploy.sh script. So devices that migrate from 22.04 to 24.04 directly will also have to be formatted at some point in future.

@Artur-at-work
Copy link
Contributor Author

@plars
I was able to test image-deloy.sh in my agent with updated device connector. The deploy script requires some changes.
Let me work on it, then upload the changes to script and connector later.

Changing this ticket to draft and will request review later.

@Artur-at-work Artur-at-work marked this pull request as draft July 20, 2024 12:26
@Artur-at-work Artur-at-work force-pushed the main branch 2 times, most recently from b08397e to 49d96b8 Compare July 23, 2024 10:16
@Artur-at-work Artur-at-work marked this pull request as ready for review July 24, 2024 02:22
@Artur-at-work
Copy link
Contributor Author

@plars hi, I've updated the description and commit.
Could you help to review please? Thank you.

Copy link
Collaborator

@plars plars left a comment

Choose a reason for hiding this comment

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

Hi, thanks for working on this! A few comments below, but it would also be great if we could test it using a real machine. I'm not aware of any in the lab that are certified for 24.04 already where we could try this, are you?

@Artur-at-work Artur-at-work changed the title Add image-deploy.sh for 24.04 in oemscripts [OEX86-359] Add device connector to provision laptops with 24.04 using image-deploy.sh [OEX86-359] Aug 7, 2024
@Artur-at-work Artur-at-work marked this pull request as draft August 7, 2024 03:21
@Artur-at-work Artur-at-work force-pushed the main branch 2 times, most recently from 2f8edee to 8aada00 Compare August 7, 2024 13:01
@Artur-at-work Artur-at-work marked this pull request as ready for review August 7, 2024 13:27
@Artur-at-work
Copy link
Contributor Author

hi @plars, thank you for the feedback, the commit was updated.
I've been provisioning the ISO image on the actual HP and Dell laptops. We don't have any certified 24.04 platform yet, but this Dell is work in progress. Can we consider these real machines? Let me know if you meant something else.

Could you review again please?

@Artur-at-work Artur-at-work requested a review from plars August 13, 2024 08:02
@Artur-at-work Artur-at-work force-pushed the main branch 3 times, most recently from 6de97b2 to 6008182 Compare August 15, 2024 13:19
Copy link
Collaborator

@plars plars left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the fixes! +1

@plars
Copy link
Collaborator

plars commented Aug 15, 2024

@Artur-at-work it looks like the only thing missing is that there are unsigned commits? We can't override this. If you need to go back and sign them, you can use a process like this to update them.

@plars
Copy link
Collaborator

plars commented Aug 15, 2024

@Artur-at-work one other question: could we get a modification to this (and hopefully the previous oemscript also), to allow downloading the iso directly to the DUT and extracting it there? That would help quite a bit. Right now, especially with the previous oemscript method, we have hundreds of these agents which sometimes get triggered all at once. Having all of these 4GB images downloading to the same agent host consumes a LOT of space very quickly. It has sometimes caused some of them to fail because of this. If we could have it pass the url to the script and the script downloads it on the DUT instead of having a local file that gets SCPed that would be really helpful.

@plars plars merged commit 69e4ec5 into canonical:main Aug 16, 2024
5 checks passed
@Artur-at-work
Copy link
Contributor Author

Artur-at-work commented Aug 16, 2024

@plars thanks for merging.
I missed one commit, and created a follow up PR here: #331

Regarding downloading the ISO directly to DUT, I've assigned a new issue to myself:
#330
Let me work on that later, after I setup this new device connector in our lab.

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