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 debugpy support & implement bundle property to raw-image yaml & schema fixes & vs code pylint support #32

Merged
merged 12 commits into from
Nov 5, 2024

Conversation

microhobby
Copy link
Contributor

This series:

  • Adds fixes to the schema tdxMeta to integrate with IDE v2
  • Add support for debugpy if the developer set TCB_DEBUGPY env var
  • Implement the bundle property into raw-image property

Open to suggestions from maintainers.

tcbuilder/backend/deploy.py Outdated Show resolved Hide resolved
@jsrc27
Copy link
Contributor

jsrc27 commented Oct 17, 2024

Seems like pylint is complaining. Could you fix what it's complaining about or disable the check for the section pylint is complaining about if needed.

@microhobby
Copy link
Contributor Author

Seems like pylint is complaining. Could you fix what it's complaining about or disable the check for the section pylint is complaining about if needed.

Yeah, I will handle this.

@microhobby microhobby force-pushed the castello/series1 branch 7 times, most recently from 5f3c468 to a94a37c Compare October 19, 2024 22:45
@microhobby microhobby changed the title Add debugpy support & implement bundle property to raw-image yaml & schema fixes Add debugpy support & implement bundle property to raw-image yaml & schema fixes & vs code pylint support Oct 19, 2024
@microhobby microhobby force-pushed the castello/series1 branch 4 times, most recently from ff9c4c8 to 900e0f0 Compare October 20, 2024 02:26
@microhobby microhobby requested a review from jsrc27 October 20, 2024 02:31
Checks if the TCB_DEBUGPY environment variable is set, if so,
it means that a developer is trying to debug the code from outside,
so, we wait for a debugger to attach to the process.

Also add the .vscode/launch.json configuration to attach to the
running process.

Signed-off-by: Matheus Castello <[email protected]>
This patch adds support for the bundle property into the raw-image,
this way users can define a docker-compose file to be bundled and
deployed into the new output raw image.

Signed-off-by: Matheus Castello <[email protected]>
This meta is deprecated, was used only on IDE v1, is better to use
the already implemented file with extensions yml and yaml.

Signed-off-by: Matheus Castello <[email protected]>
The tdxMeta should not be used here, this was a mistake that causes
the IDE v2 to try to validate the filesystem as string instead of a
list of strings.

Signed-off-by: Matheus Castello <[email protected]>
@jsrc27
Copy link
Contributor

jsrc27 commented Oct 21, 2024

Gave the latest revision another look over. Looks a lot better now that the raw image flow is more in-line with the tezi image flow.

tcbuilder/cli/build.py Outdated Show resolved Hide resolved
@lucas-akira
Copy link
Collaborator

As internally discussed with @microhobby , I'll take care of the PR from now on. I plan to keep the current commits and just add the necessary fixes/suggestions.

Copy link
Collaborator

@lucas-akira lucas-akira left a comment

Choose a reason for hiding this comment

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

Changes look good overall, with only a few points to be aware of.

tcbuilder/cli/build.py Outdated Show resolved Hide resolved
tcbuilder/backend/bundle.py Outdated Show resolved Hide resolved
tcbuilder/cli/build.py Outdated Show resolved Hide resolved
@lucas-akira
Copy link
Collaborator

lucas-akira commented Oct 29, 2024

Apparently I cannot commit changes to this Pull Request branch, so I've asked @microhobby to add here all changes that I've made on my local branch.

Edit: Just got direct access to the forked repo and I can push to it now.

Copy link
Contributor

@jsrc27 jsrc27 left a comment

Choose a reason for hiding this comment

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

Gave the latest revision a look through and I don't think I have any further comments, seems okay from my end.

@jsrc27
Copy link
Contributor

jsrc27 commented Oct 30, 2024

@rborn-tx Did you want to take a look at this as well?

@rborn-tx
Copy link
Contributor

rborn-tx commented Oct 30, 2024

Did you want to take a look at this as well?

@jsrc27 Yes! I hope to be able to do it today.

Copy link
Contributor

@rborn-tx rborn-tx left a comment

Choose a reason for hiding this comment

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

I'm halfway through the commits but I've added some comments and questions. I hope to go over the remaining commits soon...

torizoncore-builder.py Show resolved Hide resolved
tcbuilder/backend/bundle.py Outdated Show resolved Hide resolved
tcbuilder/backend/combine.py Outdated Show resolved Hide resolved
tcbuilder/backend/combine.py Outdated Show resolved Hide resolved
tcbuilder/cli/build.py Outdated Show resolved Hide resolved
tcbuilder/cli/build.py Outdated Show resolved Hide resolved
@rborn-tx rborn-tx self-requested a review October 30, 2024 22:07
Copy link
Contributor

@rborn-tx rborn-tx left a comment

Choose a reason for hiding this comment

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

Finished 1st pass. Looks good overall. It would be advisable to have tests for the new feature(s), right?

tcbuilder/backend/combine.py Outdated Show resolved Hide resolved
tcbuilder/cli/bundle.py Show resolved Hide resolved
tcbuilder/cli/build.py Outdated Show resolved Hide resolved
The bundle command will now automatically compress the docker bundle
tarfile (docker-storage.tar) if 'output_filename' from
download_containers_by_compose_file() ends with certain extensions like
.gz, .xz, etc. Otherwise, no compression will be done to the tarfile.

This was done because compression isn't necessary when bundling
container images on raw images with the build command, as the docker
bundle tarfile will be immediately unpacked on the rootfs of the output
OS image. A compressed tarfile takes longer to unpack compared to an
uncompressed one, adding unnecessary processing time that could be
avoided.

Signed-off-by: Lucas Akira Morishita <[email protected]>
When the handle_bundle_common() function was introduced, the build
command unintentionally started deleting bundle directories after
combining container images, regardless if the directory was a temporary
one or not. This commit restores the original intended behavior of only
removing bundle directories created when a docker compose yaml file is
passed to the 'bundle' section instead of a complete directory.

Signed-off-by: Lucas Akira Morishita <[email protected]>
Include bundle options to raw images, as they're now supported.

Signed-off-by: Lucas Akira Morishita <[email protected]>
In update_dt_git_repo(), the code was incorrectly passing a GitPython
Head object as the refspec argument in the Remote.fetch() method, which
should be a string or list of strings.

Newer versions of GitPython added a check that verifies if refspec is of
the expected type, throwing an error if that isn't the case. Because of
this the 'dt checkout --update' command fails if TCB was built with recent
versions of the GitPython library.

This commit removes the unnecessary refspec argument.

Signed-off-by: Lucas Akira Morishita <[email protected]>
@lucas-akira
Copy link
Collaborator

Finished 1st pass. Looks good overall. It would be advisable to have tests for the new feature(s), right?

Right, I'll add the tests then.

@lucas-akira lucas-akira merged commit aa96d35 into torizon:bullseye Nov 5, 2024
7 checks passed
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.

4 participants