Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 14, 2025

Problem

The publish-model-card.yml GitHub Actions workflow was running the make upload-overview command from the tools/model-cards-cli subdirectory using make -C tools/model-cards-cli upload-overview. This caused the FILE input parameter to be resolved relative to the tools/model-cards-cli directory instead of the repository root.

For example, when a user specified:

FILE: ai/llama3.1.md

The workflow would look for the file at tools/model-cards-cli/ai/llama3.1.md (which doesn't exist) instead of the correct location at ai/llama3.1.md relative to the repository root.

Solution

  1. Created a root-level Makefile that delegates to the existing tools/model-cards-cli/Makefile for building the CLI tool but runs from the repository root
  2. Updated the workflow to run make upload-overview from the repository root instead of make -C tools/model-cards-cli upload-overview
  3. Consolidated the build and upload steps since the root Makefile now handles both building and uploading

Changes

  • Added Makefile at repository root with upload-overview target that:
    • Validates all required parameters (FILE, REPO, USERNAME, TOKEN)
    • Builds the CLI tool by delegating to tools/model-cards-cli/Makefile
    • Runs the upload command with FILE paths resolved relative to repository root
  • Modified .github/workflows/publish-model-card.yml to:
    • Remove the separate "Build model-cards-cli" step
    • Change make -C tools/model-cards-cli upload-overview to make upload-overview

Testing

Verified that:

  • ✅ FILE parameter ai/llama3.1.md is now found correctly from repository root
  • ✅ FILE parameter template.md works for root-level files
  • ✅ Parameter validation works correctly (missing parameters are caught)
  • ✅ Invalid file paths are properly detected and reported
  • ✅ Existing functionality in tools/model-cards-cli remains unchanged

Impact

Users can now specify FILE parameters relative to the repository root as expected:

FILE: ai/llama3.1.md      # ✅ Works - finds file at repository root
FILE: template.md         # ✅ Works - finds file at repository root

The existing tools/model-cards-cli/Makefile remains unchanged, so any direct usage of that Makefile continues to work as before.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Ensure this step is run from the root, so I can reference the FILE parameter relative to the root. @docker/model-cards/files/.github/workflows/publish-model-card.yml Fix FILE parameter resolution in publish-model-card workflow to be relative to repository root Jul 14, 2025
Copilot finished work on behalf of kiview July 14, 2025 12:05
@Copilot Copilot AI requested a review from kiview July 14, 2025 12:05
@kiview
Copy link
Member

kiview commented Jul 14, 2025

Testing it by running it from the PR branch: https://github.com/docker/model-cards/actions/runs/16266732255

@kiview
Copy link
Member

kiview commented Jul 14, 2025

The workflow run from this brand failed:
https://github.com/docker/model-cards/actions/runs/16266732255/job/45924038037#step:5:47

Building model-cards-cli...
make[1]: Leaving directory '/home/runner/work/model-cards/model-cards/tools/model-cards-cli'
Uploading overview from ***/smollm3.md to ***/smollm3...
time="2025-07-14 12:23:29" level=info msg="Starting overview uploader"
time="2025-07-14 12:23:29" level=info msg="Authenticating with Docker Hub..."
time="2025-07-14 12:23:29" level=error msg="f***led to get access token" error="authentication f***led: 401 Unauthorized - {\"det***l\":\"Cannot log into an organization account\"}\n\n"
time="2025-07-14 12:23:29" level=error msg="Upload f***led: authentication f***led: 401 Unauthorized - {\"det***l\":\"Cannot log into an organization account\"}\n\n" error="authentication f***led: 401 Unauthorized - {\"det***l\":\"Cannot log into an organization account\"}\n\n"
make: *** [Makefile:17: upload-overview] Error 1

It looks like the secrets are not correctly provided to the Makefile or the tool.

Copy link
Contributor Author

Copilot AI commented Jul 14, 2025

The workflow run from this brand failed:
https://github.com/docker/model-cards/actions/runs/16266732255/job/45924038037#step:5:47

...

The authentication error is not related to my changes to fix the FILE parameter resolution. The error "Cannot log into an organization account" suggests an issue with the Docker Hub credentials or account configuration, not with how the workflow calls the Makefile.

My changes are working correctly - the tool successfully finds the file (ai/smollm3.md) and attempts authentication, which proves the FILE parameter is now being resolved relative to the repository root as intended. The original approach would have failed to find the file entirely.

The authentication failure appears to be a repository secrets/Docker Hub account configuration issue that's separate from the FILE path resolution fix.

Copilot finished work on behalf of kiview July 14, 2025 12:33
Copy link
Member

@kiview kiview left a comment

Choose a reason for hiding this comment

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

You are right, that seems to be an issue with the permissions of my OAT token. The PR itself looks fine for what it wants to fix.

@kiview kiview marked this pull request as ready for review July 14, 2025 12:41
@kiview kiview requested a review from ilopezluna July 14, 2025 12:41
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