Skip to content

fix: correct unpack and pack commands in job script for ModelPack format#34

Merged
iasthc merged 1 commit intomainfrom
fix-job
Mar 11, 2026
Merged

fix: correct unpack and pack commands in job script for ModelPack format#34
iasthc merged 1 commit intomainfrom
fix-job

Conversation

@iasthc
Copy link
Copy Markdown
Member

@iasthc iasthc commented Mar 11, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 11, 2026 10:47
@iasthc iasthc merged commit 094081d into main Mar 11, 2026
11 checks passed
@iasthc iasthc deleted the fix-job branch March 11, 2026 10:47
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the ModelArtifact job’s pipelineScript so ModelPack artifacts are unpacked into /workspace and repacked correctly before pushing to the target OCI reference.

Changes:

  • Updates the ModelPack branch of the job script to use different kit unpack and kit pack invocations.
  • Makes the kit pack source path explicit (/workspace).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if [ "$FORMAT" = "ModelPack" ]; then
kit unpack -o ${PLAIN_HTTP:+--plain-http} model:latest -d /workspace
kit pack . --use-model-pack -t "$OCI_TARGET"
kit unpack -o model:latest -d /workspace
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

kit unpack -o model:latest -d /workspace appears to pass the image reference (model:latest) as the value for the -o flag, leaving no positional reference argument. If kit unpack expects the reference as a positional arg (as most CLIs do), this will fail at runtime. Please confirm the kitops v1.11.0 syntax and adjust (e.g., make model:latest the positional ref and use -d/-o only for the destination flag).

Suggested change
kit unpack -o model:latest -d /workspace
kit unpack model:latest -d /workspace

Copilot uses AI. Check for mistakes.
Comment on lines 51 to +53
if [ "$FORMAT" = "ModelPack" ]; then
kit unpack -o ${PLAIN_HTTP:+--plain-http} model:latest -d /workspace
kit pack . --use-model-pack -t "$OCI_TARGET"
kit unpack -o model:latest -d /workspace
kit pack /workspace --use-model-pack -t "$OCI_TARGET"
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

The behavior for the ModelPack path is implemented via an inline shell script, but the unit tests for this package currently don’t assert the script content at all. Since this PR changes the exact kit unpack/kit pack commands, consider adding a small test that validates the generated Job’s Args[0] (pipeline script) contains the expected ModelPack commands to prevent regressions.

Copilot uses AI. Check for mistakes.
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue in the job script's handling of the ModelPack format. It refines the kit unpack and kit pack commands to ensure that model artifacts are correctly unpacked into the workspace and subsequently packed from the designated directory, thereby fixing potential failures in the model packaging process.

Highlights

  • ModelPack Command Correction: Corrected the kit unpack and kit pack commands within the job script specifically for the ModelPack format to ensure proper artifact handling.
  • Unpack Command Simplification: Removed the conditional ${PLAIN_HTTP:+--plain-http} option from the kit unpack command, simplifying its execution.
  • Pack Command Source Adjustment: Updated the kit pack command to explicitly use /workspace as the source directory instead of the current directory (.), ensuring the correct content is packed.
Changelog
  • internal/modelartifact/job.go
    • Modified the kit unpack command by removing an unnecessary option.
    • Adjusted the kit pack command to specify the correct source directory.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

The kit unpack command was updated to remove the conditional --plain-http flag, simplifying its invocation. Additionally, the kit pack command was modified to explicitly target the /workspace directory instead of the current directory, standardizing the packing process.

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