From 52c4eb27548c7e707ce8766840a30d6158be8a6c Mon Sep 17 00:00:00 2001 From: Naveen Kumar Date: Tue, 3 Mar 2026 12:52:30 +0530 Subject: [PATCH 1/8] Added logic for updating HF_ENDPOINT and HF_TOKEN from default or specific server details itself --- buildtools/cli.go | 68 +++++++++++++++++++++++++++++---- go.mod | 2 +- go.sum | 2 - utils/cliutils/commandsflags.go | 7 +++- 4 files changed, 67 insertions(+), 12 deletions(-) diff --git a/buildtools/cli.go b/buildtools/cli.go index 4afc9ce43..997450f2c 100644 --- a/buildtools/cli.go +++ b/buildtools/cli.go @@ -85,6 +85,9 @@ import ( const ( buildToolsCategory = "Package Managers:" + huggingfaceAPI = "api/huggingfaceml" + HF_ENDPOINT = "HF_ENDPOINT" + HF_TOKEN = "HF_TOKEN" ) func GetCommands() []cli.Command { @@ -1160,13 +1163,14 @@ func huggingFaceUploadCmd(c *cli.Context, hfArgs []string) error { if repoID == "" { return cliutils.PrintHelpAndReturnError("Repository ID cannot be empty.", c) } - serverDetails, err := coreConfig.GetDefaultServerConf() - if err != nil { - return err - } + hfArgs, serverDetails, err := getHuggingFaceServerDetails(hfArgs) if serverDetails == nil { return fmt.Errorf("no default server configuration found. Please configure a server using 'jfrog config add' or specify a server using --server-id") } + err = updateHuggingFaceEnv(c, serverDetails) + if err != nil { + return err + } buildConfiguration, err := cliutils.CreateBuildConfigurationWithModule(c) if err != nil { return err @@ -1199,13 +1203,14 @@ func huggingFaceDownloadCmd(c *cli.Context, hfArgs []string) error { if repoID == "" { return cliutils.PrintHelpAndReturnError("Model/Dataset name cannot be empty.", c) } - serverDetails, err := coreConfig.GetDefaultServerConf() - if err != nil { - return err - } + hfArgs, serverDetails, err := getHuggingFaceServerDetails(hfArgs) if serverDetails == nil { return fmt.Errorf("no default server configuration found. Please configure a server using 'jfrog config add' or specify a server using --server-id") } + err = updateHuggingFaceEnv(c, serverDetails) + if err != nil { + return err + } buildConfiguration, err := cliutils.CreateBuildConfigurationWithModule(c) if err != nil { return err @@ -1235,6 +1240,53 @@ func huggingFaceDownloadCmd(c *cli.Context, hfArgs []string) error { return commands.Exec(huggingFaceDownloadCmd) } +func getHuggingFaceServerDetails(args []string) ([]string, *coreConfig.ServerDetails, error) { + cleanedArgs, serverID, err := coreutils.ExtractServerIdFromCommand(args) + if err != nil { + return nil, nil, fmt.Errorf("failed to extract server ID: %w", err) + } + if serverID == "" { + serverDetails, err := coreConfig.GetDefaultServerConf() + if err != nil { + return cleanedArgs, nil, err + } + if serverDetails == nil { + return cleanedArgs, nil, fmt.Errorf("no default server configuration found. Please configure a server using 'jfrog config add' or specify a server using --server-id") + } + return cleanedArgs, serverDetails, nil + } + serverDetails, err := coreConfig.GetSpecificConfig(serverID, true, true) + if err != nil { + return nil, nil, fmt.Errorf("failed to get server configuration for ID '%s': %w", serverID, err) + } + return cleanedArgs, serverDetails, nil +} + +func updateHuggingFaceEnv(c *cli.Context, serverDetails *coreConfig.ServerDetails) error { + if os.Getenv(HF_ENDPOINT) == "" { + repoKey := c.String("repo-key") + if repoKey == "" { + return cliutils.PrintHelpAndReturnError("Please specify a repository key.", c) + } + hfEndpoint := serverDetails.GetArtifactoryUrl() + huggingfaceAPI + "/" + repoKey + err := os.Setenv(HF_ENDPOINT, hfEndpoint) + if err != nil { + return err + } + } + if os.Getenv(HF_TOKEN) == "" { + accessToken := serverDetails.GetAccessToken() + if accessToken == "" { + return cliutils.PrintHelpAndReturnError("You need to specify an access token.", c) + } + err := os.Setenv(HF_TOKEN, accessToken) + if err != nil { + return err + } + } + return nil +} + func dockerScanCmd(c *cli.Context, imageTag string) error { if show, err := cliutils.ShowGenericCmdHelpIfNeeded(c, c.Args(), securityCLI.DockerScanCmdHiddenName); show || err != nil { return err diff --git a/go.mod b/go.mod index 51bddf168..86e9da55f 100644 --- a/go.mod +++ b/go.mod @@ -258,7 +258,7 @@ replace github.com/ktrysmt/go-bitbucket => github.com/ktrysmt/go-bitbucket v0.9. // replace github.com/jfrog/jfrog-cli-artifactory => github.com/reshmifrog/jfrog-cli-artifactory v0.0.0-20260302170823-db801936b182 -//replace github.com/jfrog/jfrog-cli-artifactory => github.com/naveenku-jfrog/jfrog-cli-artifactory v0.0.0-20260226133041-8d510cc4e5f6 +replace github.com/jfrog/jfrog-cli-artifactory => /Users/naveenku/Desktop/eco-matrix/jfrog-cli-artifactory //replace github.com/jfrog/build-info-go => github.com/fluxxBot/build-info-go v1.10.10-0.20260105070825-d3f36f619ba5 diff --git a/go.sum b/go.sum index 76385b282..ec540b3ed 100644 --- a/go.sum +++ b/go.sum @@ -417,8 +417,6 @@ github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYL github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w= github.com/jfrog/jfrog-cli-application v1.0.2-0.20260216085810-1ade6c26b3df h1:raSyae8/h1y8HtzFLf7vZZj91fP/qD94AX+biwBJiqs= github.com/jfrog/jfrog-cli-application v1.0.2-0.20260216085810-1ade6c26b3df/go.mod h1:xum2HquWO5uExa/A7MQs3TgJJVEeoqTR+6Z4mfBr1Xw= -github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260303052518-917c005de223 h1:amcFRt9xKmWZBsoT++amBoGrHiF28lTbWqr5yxHz+dI= -github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260303052518-917c005de223/go.mod h1:P9ZywyTQzp+WsNmeb4IiMQOdVb++eQUD5oXd18LRVj8= github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260218080258-3bf55ed18973 h1:fOlWUGkCuujnIcE3166gpTdvicwv1wAZhLrfbm+f6rY= github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260218080258-3bf55ed18973/go.mod h1:GDveG1xAoiM12JlSx8RE0OcJ6Ov+xcmpmGv84we3pMA= github.com/jfrog/jfrog-cli-evidence v0.8.3-0.20260202100913-d9ee9476845a h1:lTOAhUjKcOmM/0Kbj4V+I/VHPlW7YNAhIEVpGnCM5mI= diff --git a/utils/cliutils/commandsflags.go b/utils/cliutils/commandsflags.go index ceb97d2e4..71be17780 100644 --- a/utils/cliutils/commandsflags.go +++ b/utils/cliutils/commandsflags.go @@ -599,6 +599,7 @@ const ( Revision = "revision" RepoType = "repo-type" EtagTimeout = "etag-timeout" + RepoKey = "repo-key" ) var flagsMap = map[string]cli.Flag{ @@ -1767,6 +1768,10 @@ var flagsMap = map[string]cli.Flag{ Name: RepoType, Usage: "[Default: model] Type of repository. Can be 'model', 'dataset'.` `", }, + RepoKey: cli.StringFlag{ + Name: RepoKey, + Usage: "Repository Key for uploading/downloading dataset/models.", + }, } var commandFlags = map[string][]string{ @@ -2000,7 +2005,7 @@ var commandFlags = map[string][]string{ BuildName, BuildNumber, module, Project, serverId, username, password, }, HuggingFace: { - BuildName, BuildNumber, module, Project, serverId, Revision, RepoType, EtagTimeout, + BuildName, BuildNumber, module, Project, serverId, Revision, RepoType, EtagTimeout, RepoKey, }, RubyConfig: { global, serverIdResolve, serverIdDeploy, repoResolve, repoDeploy, From f63403303431c68f453d99418ccae1eae0c8a825 Mon Sep 17 00:00:00 2001 From: Naveen Kumar Date: Tue, 3 Mar 2026 14:04:26 +0530 Subject: [PATCH 2/8] Updated go.mod and go.sum --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 86e9da55f..0f9fd798a 100644 --- a/go.mod +++ b/go.mod @@ -258,7 +258,7 @@ replace github.com/ktrysmt/go-bitbucket => github.com/ktrysmt/go-bitbucket v0.9. // replace github.com/jfrog/jfrog-cli-artifactory => github.com/reshmifrog/jfrog-cli-artifactory v0.0.0-20260302170823-db801936b182 -replace github.com/jfrog/jfrog-cli-artifactory => /Users/naveenku/Desktop/eco-matrix/jfrog-cli-artifactory +//replace github.com/jfrog/jfrog-cli-artifactory => /Users/naveenku/Desktop/eco-matrix/jfrog-cli-artifactory //replace github.com/jfrog/build-info-go => github.com/fluxxBot/build-info-go v1.10.10-0.20260105070825-d3f36f619ba5 diff --git a/go.sum b/go.sum index ec540b3ed..76385b282 100644 --- a/go.sum +++ b/go.sum @@ -417,6 +417,8 @@ github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYL github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w= github.com/jfrog/jfrog-cli-application v1.0.2-0.20260216085810-1ade6c26b3df h1:raSyae8/h1y8HtzFLf7vZZj91fP/qD94AX+biwBJiqs= github.com/jfrog/jfrog-cli-application v1.0.2-0.20260216085810-1ade6c26b3df/go.mod h1:xum2HquWO5uExa/A7MQs3TgJJVEeoqTR+6Z4mfBr1Xw= +github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260303052518-917c005de223 h1:amcFRt9xKmWZBsoT++amBoGrHiF28lTbWqr5yxHz+dI= +github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260303052518-917c005de223/go.mod h1:P9ZywyTQzp+WsNmeb4IiMQOdVb++eQUD5oXd18LRVj8= github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260218080258-3bf55ed18973 h1:fOlWUGkCuujnIcE3166gpTdvicwv1wAZhLrfbm+f6rY= github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260218080258-3bf55ed18973/go.mod h1:GDveG1xAoiM12JlSx8RE0OcJ6Ov+xcmpmGv84we3pMA= github.com/jfrog/jfrog-cli-evidence v0.8.3-0.20260202100913-d9ee9476845a h1:lTOAhUjKcOmM/0Kbj4V+I/VHPlW7YNAhIEVpGnCM5mI= From db7b42b098d1936570717a0d51681e8b3f27be6b Mon Sep 17 00:00:00 2001 From: Naveen Kumar Date: Tue, 3 Mar 2026 14:57:38 +0530 Subject: [PATCH 3/8] Updated test cases for accepting repo-key by default --- huggingface_test.go | 49 +++++++++++-------- .../huggingface_remote_repository_config.json | 6 +++ utils/tests/consts.go | 2 + utils/tests/utils.go | 6 ++- 4 files changed, 41 insertions(+), 22 deletions(-) create mode 100644 testdata/huggingface_remote_repository_config.json diff --git a/huggingface_test.go b/huggingface_test.go index fc4ce99af..6e4cdb6d2 100644 --- a/huggingface_test.go +++ b/huggingface_test.go @@ -45,14 +45,12 @@ func initHuggingFaceTest(t *testing.T) { serverDetails.Password = *tests.JfrogPassword } - // NOTE: We do NOT auto-set HF_ENDPOINT here. - // If HF_ENDPOINT is not set, downloads go directly to HuggingFace Hub (huggingface.co) - // If HF_ENDPOINT is set (by user/CI), downloads go through Artifactory - // Build info tests will skip if HF_ENDPOINT is not set since they require Artifactory } func cleanHuggingFaceTest(t *testing.T) { clientTestUtils.UnSetEnvAndAssert(t, coreutils.HomeDir) + clientTestUtils.UnSetEnvAndAssert(t, "HF_ENDPOINT") + clientTestUtils.UnSetEnvAndAssert(t, "HF_TOKEN") tests.CleanFileSystem() } @@ -136,6 +134,7 @@ func TestHuggingFaceDownload(t *testing.T) { args := []string{ "hf", "d", "sshleifer/tiny-gpt2", "--repo-type=model", + "--repo-key=" + tests.HuggingFaceRemoteRepo, } // Execute and verify success @@ -162,6 +161,7 @@ func TestHuggingFaceDownloadWithRevision(t *testing.T) { "hf", "d", "sshleifer/tiny-gpt2", "--repo-type=model", "--revision=main", + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err := jfrogCli.Exec(args...) @@ -186,6 +186,7 @@ func TestHuggingFaceDownloadDataset(t *testing.T) { args := []string{ "hf", "d", "hf-internal-testing/fixtures_image_utils", "--repo-type=dataset", + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err := jfrogCli.Exec(args...) @@ -219,6 +220,7 @@ func TestHuggingFaceDownloadWithEtagTimeout(t *testing.T) { "hf", "d", "sshleifer/tiny-gpt2", "--repo-type=model", "--etag-timeout=3600", + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err := jfrogCli.Exec(args...) @@ -259,6 +261,7 @@ func TestHuggingFaceUpload(t *testing.T) { args := []string{ "hf", "u", tempDir, "test-org/test-model", "--repo-type=model", + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err = jfrogCli.Exec(args...) @@ -296,6 +299,7 @@ func TestHuggingFaceUploadWithRevision(t *testing.T) { "hf", "u", tempDir, "test-org/test-model", "--repo-type=model", "--revision=test-branch", + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err = jfrogCli.Exec(args...) @@ -336,6 +340,7 @@ func TestHuggingFaceUploadDataset(t *testing.T) { args := []string{ "hf", "u", tempDir, "test-org/test-dataset", "--repo-type=dataset", + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err = jfrogCli.Exec(args...) @@ -414,6 +419,7 @@ func TestHuggingFaceDownloadInvalidRepoID(t *testing.T) { args := []string{ "hf", "d", "non-existent-org/non-existent-model-12345xyz", "--repo-type=model", + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err := jfrogCli.Exec(args...) @@ -460,6 +466,7 @@ func TestHuggingFaceUploadEmptyDirectory(t *testing.T) { args := []string{ "hf", "u", tempDir, "test-org/test-empty-model", "--repo-type=model", + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err = jfrogCli.Exec(args...) @@ -491,6 +498,7 @@ func TestHuggingFaceUploadNonExistentDirectory(t *testing.T) { args := []string{ "hf", "u", "/non/existent/path/to/model", "test-org/test-model", "--repo-type=model", + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err := jfrogCli.Exec(args...) @@ -544,6 +552,7 @@ func TestHuggingFaceUploadWithSpecialCharactersInPath(t *testing.T) { args := []string{ "hf", "u", specialDir, "test-org/test-special-chars-model", "--repo-type=model", + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err = jfrogCli.Exec(args...) @@ -581,6 +590,7 @@ func TestHuggingFaceUploadOverwrite(t *testing.T) { args := []string{ "hf", "u", tempDir, repoID, "--repo-type=model", + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err = jfrogCli.Exec(args...) @@ -617,15 +627,9 @@ func TestHuggingFaceDownloadWithBuildInfo(t *testing.T) { // Check if python3 and huggingface_hub are available checkHuggingFaceHubAvailable(t) - // Build info collection requires HF_ENDPOINT to be set (Artifactory HuggingFace remote) - // Skip if not configured - this test requires Artifactory setup - if os.Getenv("HF_ENDPOINT") == "" { - t.Skip("Skipping build info test: HF_ENDPOINT not set. Set HF_ENDPOINT to your Artifactory HuggingFace remote URL to run this test.") - } - jfrogCli := coreTests.NewJfrogCli(execMain, "jfrog", "") - buildName := "hf-download-build-test" + buildName := tests.HuggingFaceBuildName + "-download" buildNumber := "1" // Test download with build info flags @@ -635,6 +639,7 @@ func TestHuggingFaceDownloadWithBuildInfo(t *testing.T) { "--repo-type=model", "--build-name=" + buildName, "--build-number=" + buildNumber, + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err := jfrogCli.Exec(args...) @@ -682,7 +687,7 @@ func TestHuggingFaceUploadWithBuildInfo(t *testing.T) { jfrogCli := coreTests.NewJfrogCli(execMain, "jfrog", "") - buildName := "hf-upload-build-test" + buildName := tests.HuggingFaceBuildName + "-upload" buildNumber := "1" // Test upload with build info flags @@ -691,6 +696,7 @@ func TestHuggingFaceUploadWithBuildInfo(t *testing.T) { "--repo-type=model", "--build-name=" + buildName, "--build-number=" + buildNumber, + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err = jfrogCli.Exec(args...) @@ -715,15 +721,9 @@ func TestHuggingFaceDownloadWithBuildInfoAndModule(t *testing.T) { // Check if python3 and huggingface_hub are available checkHuggingFaceHubAvailable(t) - // Build info collection requires HF_ENDPOINT to be set (Artifactory HuggingFace remote) - // Skip if not configured - this test requires Artifactory setup - if os.Getenv("HF_ENDPOINT") == "" { - t.Skip("Skipping build info test: HF_ENDPOINT not set. Set HF_ENDPOINT to your Artifactory HuggingFace remote URL to run this test.") - } - jfrogCli := coreTests.NewJfrogCli(execMain, "jfrog", "") - buildName := "hf-download-module-build-test" + buildName := tests.HuggingFaceBuildName + "-download-module" buildNumber := "1" moduleName := "tiny-bert-model-module" @@ -735,6 +735,7 @@ func TestHuggingFaceDownloadWithBuildInfoAndModule(t *testing.T) { "--build-name=" + buildName, "--build-number=" + buildNumber, "--module=" + moduleName, + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err := jfrogCli.Exec(args...) @@ -777,7 +778,7 @@ func TestHuggingFaceUploadWithBuildInfoAndProject(t *testing.T) { jfrogCli := coreTests.NewJfrogCli(execMain, "jfrog", "") - buildName := "hf-upload-project-build-test" + buildName := tests.HuggingFaceBuildName + "-upload-project" buildNumber := "1" projectKey := "test-project" @@ -788,6 +789,7 @@ func TestHuggingFaceUploadWithBuildInfoAndProject(t *testing.T) { "--build-name=" + buildName, "--build-number=" + buildNumber, "--project=" + projectKey, + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err = jfrogCli.Exec(args...) @@ -822,6 +824,7 @@ func TestHuggingFaceDownloadAndVerifyCache(t *testing.T) { args := []string{ "hf", "d", "sshleifer/tiny-gpt2", "--repo-type=model", + "--repo-key=" + tests.HuggingFaceRemoteRepo, } err := jfrogCli.Exec(args...) @@ -863,9 +866,13 @@ func TestHuggingFaceDownloadAndVerifyCache(t *testing.T) { // InitHuggingFaceTests initializes HuggingFace tests func InitHuggingFaceTests() { initArtifactoryCli() + cleanUpOldBuilds() + cleanUpOldRepositories() + tests.AddTimestampToGlobalVars() + createRequiredRepos() } // CleanHuggingFaceTests cleans up after HuggingFace tests func CleanHuggingFaceTests() { - // Cleanup is handled per-test + deleteCreatedRepos() } diff --git a/testdata/huggingface_remote_repository_config.json b/testdata/huggingface_remote_repository_config.json new file mode 100644 index 000000000..6b7a0a1a3 --- /dev/null +++ b/testdata/huggingface_remote_repository_config.json @@ -0,0 +1,6 @@ +{ + "key": "${HUGGINGFACE_REMOTE_REPO}", + "rclass": "remote", + "packageType": "huggingfaceml", + "url": "https://huggingface.co" +} diff --git a/utils/tests/consts.go b/utils/tests/consts.go index ad7b8e1d1..766274287 100644 --- a/utils/tests/consts.go +++ b/utils/tests/consts.go @@ -112,6 +112,7 @@ const ( ConanRemoteRepositoryConfig = "conan_remote_repository_config.json" ConanVirtualRepositoryConfig = "conan_virtual_repository_config.json" HelmLocalRepositoryConfig = "helm_local_repository_config.json" + HuggingFaceRemoteRepositoryConfig = "huggingface_remote_repository_config.json" ReplicationTempCreate = "replication_push_create.json" Repo1RepositoryConfig = "repo1_repository_config.json" Repo2RepositoryConfig = "repo2_repository_config.json" @@ -213,6 +214,7 @@ var ( ConanRemoteRepo = "cli-conan-remote" ConanVirtualRepo = "cli-conan-virtual" HelmLocalRepo = "cli-helm-local" + HuggingFaceRemoteRepo = "cli-huggingface-remote" DockerLocalRepo = "cli-docker-local" DockerLocalPromoteRepo = "cli-docker-local-promote" DockerRemoteRepo = "cli-docker-remote" diff --git a/utils/tests/utils.go b/utils/tests/utils.go index f74c1ecaf..4da16a868 100644 --- a/utils/tests/utils.go +++ b/utils/tests/utils.go @@ -289,6 +289,7 @@ var reposConfigMap = map[*string]string{ &ConanRemoteRepo: ConanRemoteRepositoryConfig, &ConanVirtualRepo: ConanVirtualRepositoryConfig, &HelmLocalRepo: HelmLocalRepositoryConfig, + &HuggingFaceRemoteRepo: HuggingFaceRemoteRepositoryConfig, &RtDebianRepo: DebianTestRepositoryConfig, &RtLfsRepo: GitLfsTestRepositoryConfig, &RtRepo1: Repo1RepositoryConfig, @@ -355,7 +356,7 @@ func GetNonVirtualRepositories() map[*string]string { TestPoetry: {&PoetryLocalRepo, &PoetryRemoteRepo}, TestConan: {&ConanLocalRepo, &ConanRemoteRepo}, TestHelm: {&HelmLocalRepo}, - TestHuggingFace: {}, + TestHuggingFace: {&HuggingFaceRemoteRepo}, TestPlugins: {&RtRepo1}, TestXray: {&NpmRemoteRepo, &NugetRemoteRepo, &YarnRemoteRepo, &GradleRemoteRepo, &MvnRemoteRepo, &GoRepo, &GoRemoteRepo, &PypiRemoteRepo}, TestAccess: {&RtRepo1}, @@ -485,6 +486,7 @@ func getSubstitutionMap() map[string]string { "${CONAN_REMOTE_REPO}": ConanRemoteRepo, "${CONAN_VIRTUAL_REPO}": ConanVirtualRepo, "${HELM_REPO}": HelmLocalRepo, + "${HUGGINGFACE_REMOTE_REPO}": HuggingFaceRemoteRepo, "${BUILD_NAME1}": RtBuildName1, "${BUILD_NAME2}": RtBuildName2, "${BUNDLE_NAME}": BundleName, @@ -554,6 +556,7 @@ func AddTimestampToGlobalVars() { ConanRemoteRepo += uniqueSuffix ConanVirtualRepo += uniqueSuffix HelmLocalRepo += uniqueSuffix + HuggingFaceRemoteRepo += uniqueSuffix RtDebianRepo += uniqueSuffix RtLfsRepo += uniqueSuffix RtRepo1 += uniqueSuffix @@ -581,6 +584,7 @@ func AddTimestampToGlobalVars() { PoetryBuildName += uniqueSuffix ConanBuildName += uniqueSuffix HelmBuildName += uniqueSuffix + HuggingFaceBuildName += uniqueSuffix RtBuildName1 += uniqueSuffix RtBuildName2 += uniqueSuffix RtBuildNameWithSpecialChars += uniqueSuffix From 9557d6412344caf0bb2923cee1cb2eb216c3e8ac Mon Sep 17 00:00:00 2001 From: Naveen Kumar Date: Wed, 4 Mar 2026 01:19:10 +0530 Subject: [PATCH 4/8] Updated test cases for accepting repo-key by default --- huggingface_test.go | 209 +++++++++--------- .../huggingface_local_repository_config.json | 5 + .../huggingface_remote_repository_config.json | 6 - utils/tests/consts.go | 4 +- utils/tests/utils.go | 8 +- 5 files changed, 113 insertions(+), 119 deletions(-) create mode 100644 testdata/huggingface_local_repository_config.json delete mode 100644 testdata/huggingface_remote_repository_config.json diff --git a/huggingface_test.go b/huggingface_test.go index 6e4cdb6d2..f71ad8ac9 100644 --- a/huggingface_test.go +++ b/huggingface_test.go @@ -118,30 +118,63 @@ func isArtifactoryAuthError(err error) bool { return isArtifactoryRelated && isAuthError } +// uploadTestModelToLocalRepo uploads minimal test model files to the local HuggingFace repo +// so that subsequent download tests have something to retrieve. +func uploadTestModelToLocalRepo(t *testing.T, jfrogCli *coreTests.JfrogCli, repoID string) { + t.Helper() + tempDir, err := os.MkdirTemp("", "hf-local-setup-*") + require.NoError(t, err, "Setup: failed to create temp dir") + t.Cleanup(func() { _ = os.RemoveAll(tempDir) }) + + require.NoError(t, os.WriteFile(filepath.Join(tempDir, "config.json"), []byte(`{"model_type":"test"}`), 0644)) + require.NoError(t, os.WriteFile(filepath.Join(tempDir, "model.bin"), []byte("test model binary content"), 0644)) + + args := []string{ + "hf", "u", tempDir, repoID, + "--repo-type=model", + "--repo-key=" + tests.HuggingFaceLocalRepo, + } + require.NoError(t, jfrogCli.Exec(args...), "Setup: upload to local repo failed for "+repoID) +} + +// uploadTestDatasetToLocalRepo uploads minimal test dataset files to the local HuggingFace repo. +func uploadTestDatasetToLocalRepo(t *testing.T, jfrogCli *coreTests.JfrogCli, repoID string) { + t.Helper() + tempDir, err := os.MkdirTemp("", "hf-local-dataset-setup-*") + require.NoError(t, err, "Setup: failed to create temp dir for dataset") + t.Cleanup(func() { _ = os.RemoveAll(tempDir) }) + + require.NoError(t, os.WriteFile(filepath.Join(tempDir, "train.json"), []byte(`[{"text":"sample training data"}]`), 0644)) + require.NoError(t, os.WriteFile(filepath.Join(tempDir, "test.json"), []byte(`[{"text":"sample test data"}]`), 0644)) + + args := []string{ + "hf", "u", tempDir, repoID, + "--repo-type=dataset", + "--repo-key=" + tests.HuggingFaceLocalRepo, + } + require.NoError(t, jfrogCli.Exec(args...), "Setup: upload dataset to local repo failed for "+repoID) +} + // TestHuggingFaceDownload tests the HuggingFace download command func TestHuggingFaceDownload(t *testing.T) { initHuggingFaceTest(t) defer cleanHuggingFaceTest(t) - // Check if python3 and huggingface_hub are available checkHuggingFaceHubAvailable(t) - // Test download with a small test model jfrogCli := coreTests.NewJfrogCli(execMain, "jfrog", "") + repoID := "test-org/test-model" - // Test basic download command structure - // Using sshleifer/tiny-gpt2 which is a very small model (~2MB) designed for testing + // Upload test files to the local repo first + uploadTestModelToLocalRepo(t, jfrogCli, repoID) + + // Download from the local repo args := []string{ - "hf", "d", "sshleifer/tiny-gpt2", + "hf", "d", repoID, "--repo-type=model", - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } - - // Execute and verify success err := jfrogCli.Exec(args...) - if isArtifactoryAuthError(err) { - t.Skipf("Skipping: HF_ENDPOINT is set but Artifactory auth failed: %v", err) - } assert.NoError(t, err, "HuggingFace download command should succeed") } @@ -150,24 +183,22 @@ func TestHuggingFaceDownloadWithRevision(t *testing.T) { initHuggingFaceTest(t) defer cleanHuggingFaceTest(t) - // Check if python3 and huggingface_hub are available checkHuggingFaceHubAvailable(t) jfrogCli := coreTests.NewJfrogCli(execMain, "jfrog", "") + repoID := "test-org/test-model-revision" - // Test download with revision parameter - // Using sshleifer/tiny-gpt2 which is a very small model (~2MB) designed for testing + // Upload test files to the local repo first (uploaded to default 'main' branch) + uploadTestModelToLocalRepo(t, jfrogCli, repoID) + + // Download from the local repo specifying revision=main args := []string{ - "hf", "d", "sshleifer/tiny-gpt2", + "hf", "d", repoID, "--repo-type=model", "--revision=main", - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } - err := jfrogCli.Exec(args...) - if isArtifactoryAuthError(err) { - t.Skipf("Skipping: HF_ENDPOINT is set but Artifactory auth failed: %v", err) - } assert.NoError(t, err, "HuggingFace download with revision should succeed") } @@ -176,32 +207,22 @@ func TestHuggingFaceDownloadDataset(t *testing.T) { initHuggingFaceTest(t) defer cleanHuggingFaceTest(t) - // Check if python3 and huggingface_hub are available checkHuggingFaceHubAvailable(t) jfrogCli := coreTests.NewJfrogCli(execMain, "jfrog", "") + repoID := "test-org/test-dataset" - // Test download dataset - // Using hf-internal-testing/fixtures_image_utils which is a tiny test dataset (~100KB) + // Upload test dataset files to the local repo first + uploadTestDatasetToLocalRepo(t, jfrogCli, repoID) + + // Download the dataset from the local repo args := []string{ - "hf", "d", "hf-internal-testing/fixtures_image_utils", + "hf", "d", repoID, "--repo-type=dataset", - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } - err := jfrogCli.Exec(args...) - if err != nil { - if isArtifactoryAuthError(err) { - t.Skipf("Skipping: HF_ENDPOINT is set but Artifactory auth failed: %v", err) - } - // Accept timeout errors as expected when running without HF_TOKEN (rate limiting) - errStr := strings.ToLower(err.Error()) - if strings.Contains(errStr, "timeout") || strings.Contains(errStr, "timed out") { - t.Skipf("Dataset download timed out (likely due to HF rate limiting without HF_TOKEN): %v", err) - } - // Fail on other unexpected errors - assert.NoError(t, err, "HuggingFace download dataset should succeed") - } + assert.NoError(t, err, "HuggingFace download dataset should succeed") } // TestHuggingFaceDownloadWithEtagTimeout tests the HuggingFace download command with etag-timeout @@ -209,24 +230,22 @@ func TestHuggingFaceDownloadWithEtagTimeout(t *testing.T) { initHuggingFaceTest(t) defer cleanHuggingFaceTest(t) - // Check if python3 and huggingface_hub are available checkHuggingFaceHubAvailable(t) jfrogCli := coreTests.NewJfrogCli(execMain, "jfrog", "") + repoID := "test-org/test-model-etag" + + // Upload test files to the local repo first + uploadTestModelToLocalRepo(t, jfrogCli, repoID) - // Test download with etag-timeout parameter - // Using sshleifer/tiny-gpt2 which is a very small model (~2MB) designed for testing + // Download from the local repo with etag-timeout parameter args := []string{ - "hf", "d", "sshleifer/tiny-gpt2", + "hf", "d", repoID, "--repo-type=model", "--etag-timeout=3600", - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } - err := jfrogCli.Exec(args...) - if isArtifactoryAuthError(err) { - t.Skipf("Skipping: HF_ENDPOINT is set but Artifactory auth failed: %v", err) - } assert.NoError(t, err, "HuggingFace download with etag-timeout should succeed") } @@ -261,7 +280,7 @@ func TestHuggingFaceUpload(t *testing.T) { args := []string{ "hf", "u", tempDir, "test-org/test-model", "--repo-type=model", - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } err = jfrogCli.Exec(args...) @@ -299,7 +318,7 @@ func TestHuggingFaceUploadWithRevision(t *testing.T) { "hf", "u", tempDir, "test-org/test-model", "--repo-type=model", "--revision=test-branch", - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } err = jfrogCli.Exec(args...) @@ -340,7 +359,7 @@ func TestHuggingFaceUploadDataset(t *testing.T) { args := []string{ "hf", "u", tempDir, "test-org/test-dataset", "--repo-type=dataset", - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } err = jfrogCli.Exec(args...) @@ -419,7 +438,7 @@ func TestHuggingFaceDownloadInvalidRepoID(t *testing.T) { args := []string{ "hf", "d", "non-existent-org/non-existent-model-12345xyz", "--repo-type=model", - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } err := jfrogCli.Exec(args...) @@ -466,7 +485,7 @@ func TestHuggingFaceUploadEmptyDirectory(t *testing.T) { args := []string{ "hf", "u", tempDir, "test-org/test-empty-model", "--repo-type=model", - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } err = jfrogCli.Exec(args...) @@ -498,7 +517,7 @@ func TestHuggingFaceUploadNonExistentDirectory(t *testing.T) { args := []string{ "hf", "u", "/non/existent/path/to/model", "test-org/test-model", "--repo-type=model", - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } err := jfrogCli.Exec(args...) @@ -552,7 +571,7 @@ func TestHuggingFaceUploadWithSpecialCharactersInPath(t *testing.T) { args := []string{ "hf", "u", specialDir, "test-org/test-special-chars-model", "--repo-type=model", - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } err = jfrogCli.Exec(args...) @@ -590,7 +609,7 @@ func TestHuggingFaceUploadOverwrite(t *testing.T) { args := []string{ "hf", "u", tempDir, repoID, "--repo-type=model", - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } err = jfrogCli.Exec(args...) @@ -624,39 +643,29 @@ func TestHuggingFaceDownloadWithBuildInfo(t *testing.T) { initHuggingFaceTest(t) defer cleanHuggingFaceTest(t) - // Check if python3 and huggingface_hub are available checkHuggingFaceHubAvailable(t) jfrogCli := coreTests.NewJfrogCli(execMain, "jfrog", "") + repoID := "test-org/test-model-buildinfo" + + // Upload test files to the local repo first + uploadTestModelToLocalRepo(t, jfrogCli, repoID) buildName := tests.HuggingFaceBuildName + "-download" buildNumber := "1" - // Test download with build info flags - // Using sshleifer/tiny-gpt2 which is a very small model (~2MB) designed for testing + // Download from the local repo with build info flags args := []string{ - "hf", "d", "sshleifer/tiny-gpt2", + "hf", "d", repoID, "--repo-type=model", "--build-name=" + buildName, "--build-number=" + buildNumber, - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } - err := jfrogCli.Exec(args...) - // Build info collection requires Artifactory HuggingFace remote repo to be configured - if err != nil { - errStr := strings.ToLower(err.Error()) - if strings.Contains(errStr, "connection refused") || strings.Contains(errStr, "connection reset") || - strings.Contains(errStr, "no such host") || strings.Contains(errStr, "aql") || - strings.Contains(errStr, "401") || strings.Contains(errStr, "unauthorized") { - t.Skipf("Skipping: Artifactory HuggingFace remote repo not properly configured: %v", err) - } - assert.NoError(t, err, "HuggingFace download with build info should succeed") - } + assert.NoError(t, err, "HuggingFace download with build info should succeed") - // Clean up build info t.Cleanup(func() { - // Attempt to clean build info (may fail if not created, which is fine) _ = jfrogCli.Exec("rt", "build-discard", buildName, "--max-builds=0") }) } @@ -696,7 +705,7 @@ func TestHuggingFaceUploadWithBuildInfo(t *testing.T) { "--repo-type=model", "--build-name=" + buildName, "--build-number=" + buildNumber, - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } err = jfrogCli.Exec(args...) @@ -718,39 +727,30 @@ func TestHuggingFaceDownloadWithBuildInfoAndModule(t *testing.T) { initHuggingFaceTest(t) defer cleanHuggingFaceTest(t) - // Check if python3 and huggingface_hub are available checkHuggingFaceHubAvailable(t) jfrogCli := coreTests.NewJfrogCli(execMain, "jfrog", "") + repoID := "test-org/test-model-module" + + // Upload test files to the local repo first + uploadTestModelToLocalRepo(t, jfrogCli, repoID) buildName := tests.HuggingFaceBuildName + "-download-module" buildNumber := "1" - moduleName := "tiny-bert-model-module" + moduleName := "test-model-module" - // Test download with build info and module flags - // Using sshleifer/tiny-gpt2 which is a very small model (~2MB) designed for testing + // Download from the local repo with build info and module flags args := []string{ - "hf", "d", "sshleifer/tiny-gpt2", + "hf", "d", repoID, "--repo-type=model", "--build-name=" + buildName, "--build-number=" + buildNumber, "--module=" + moduleName, - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } - err := jfrogCli.Exec(args...) - // Build info collection requires Artifactory HuggingFace remote repo to be configured - if err != nil { - errStr := strings.ToLower(err.Error()) - if strings.Contains(errStr, "connection refused") || strings.Contains(errStr, "connection reset") || - strings.Contains(errStr, "no such host") || strings.Contains(errStr, "aql") || - strings.Contains(errStr, "401") || strings.Contains(errStr, "unauthorized") { - t.Skipf("Skipping: Artifactory HuggingFace remote repo not properly configured: %v", err) - } - assert.NoError(t, err, "HuggingFace download with build info and module should succeed") - } + assert.NoError(t, err, "HuggingFace download with build info and module should succeed") - // Clean up build info t.Cleanup(func() { _ = jfrogCli.Exec("rt", "build-discard", buildName, "--max-builds=0") }) @@ -789,7 +789,7 @@ func TestHuggingFaceUploadWithBuildInfoAndProject(t *testing.T) { "--build-name=" + buildName, "--build-number=" + buildNumber, "--project=" + projectKey, - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } err = jfrogCli.Exec(args...) @@ -814,46 +814,41 @@ func TestHuggingFaceDownloadAndVerifyCache(t *testing.T) { initHuggingFaceTest(t) defer cleanHuggingFaceTest(t) - // Check if python3 and huggingface_hub are available checkHuggingFaceHubAvailable(t) jfrogCli := coreTests.NewJfrogCli(execMain, "jfrog", "") + repoID := "test-org/test-model-cache" - // Download a small model (using model instead of dataset to avoid HF rate limiting issues) - // This test verifies that downloaded files are cached correctly + // Upload test files to the local repo first + uploadTestModelToLocalRepo(t, jfrogCli, repoID) + + // Download from the local repo args := []string{ - "hf", "d", "sshleifer/tiny-gpt2", + "hf", "d", repoID, "--repo-type=model", - "--repo-key=" + tests.HuggingFaceRemoteRepo, + "--repo-key=" + tests.HuggingFaceLocalRepo, } - err := jfrogCli.Exec(args...) if err != nil { - // Skip verification if download failed (might be network/auth issues) t.Skipf("Download failed, skipping file verification: %v", err) } - // Get HuggingFace cache directory + // Verify files are cached under ~/.cache/huggingface/hub/ homeDir, err := os.UserHomeDir() require.NoError(t, err, "Failed to get user home directory") - // HuggingFace typically caches to ~/.cache/huggingface/hub/ hfCacheDir := filepath.Join(homeDir, ".cache", "huggingface", "hub") - - // Check if cache directory exists if _, err := os.Stat(hfCacheDir); os.IsNotExist(err) { t.Log("HuggingFace cache directory not found at default location, skipping file verification") return } - // Verify some files exist in cache (model files are cached with specific naming) found := false err = filepath.Walk(hfCacheDir, func(path string, info os.FileInfo, walkErr error) error { if walkErr != nil { - // Skip inaccessible directories/files and continue walking return filepath.SkipDir } - if strings.Contains(path, "tiny-gpt2") { + if strings.Contains(path, "test-model-cache") { found = true return filepath.SkipDir } diff --git a/testdata/huggingface_local_repository_config.json b/testdata/huggingface_local_repository_config.json new file mode 100644 index 000000000..216993f9c --- /dev/null +++ b/testdata/huggingface_local_repository_config.json @@ -0,0 +1,5 @@ +{ + "key": "${HUGGINGFACE_LOCAL_REPO}", + "rclass": "local", + "packageType": "huggingfaceml" +} diff --git a/testdata/huggingface_remote_repository_config.json b/testdata/huggingface_remote_repository_config.json deleted file mode 100644 index 6b7a0a1a3..000000000 --- a/testdata/huggingface_remote_repository_config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "key": "${HUGGINGFACE_REMOTE_REPO}", - "rclass": "remote", - "packageType": "huggingfaceml", - "url": "https://huggingface.co" -} diff --git a/utils/tests/consts.go b/utils/tests/consts.go index 766274287..c7319852f 100644 --- a/utils/tests/consts.go +++ b/utils/tests/consts.go @@ -112,7 +112,7 @@ const ( ConanRemoteRepositoryConfig = "conan_remote_repository_config.json" ConanVirtualRepositoryConfig = "conan_virtual_repository_config.json" HelmLocalRepositoryConfig = "helm_local_repository_config.json" - HuggingFaceRemoteRepositoryConfig = "huggingface_remote_repository_config.json" + HuggingFaceLocalRepositoryConfig = "huggingface_local_repository_config.json" ReplicationTempCreate = "replication_push_create.json" Repo1RepositoryConfig = "repo1_repository_config.json" Repo2RepositoryConfig = "repo2_repository_config.json" @@ -214,7 +214,7 @@ var ( ConanRemoteRepo = "cli-conan-remote" ConanVirtualRepo = "cli-conan-virtual" HelmLocalRepo = "cli-helm-local" - HuggingFaceRemoteRepo = "cli-huggingface-remote" + HuggingFaceLocalRepo = "cli-huggingface-local" DockerLocalRepo = "cli-docker-local" DockerLocalPromoteRepo = "cli-docker-local-promote" DockerRemoteRepo = "cli-docker-remote" diff --git a/utils/tests/utils.go b/utils/tests/utils.go index 4da16a868..64a18622a 100644 --- a/utils/tests/utils.go +++ b/utils/tests/utils.go @@ -289,7 +289,7 @@ var reposConfigMap = map[*string]string{ &ConanRemoteRepo: ConanRemoteRepositoryConfig, &ConanVirtualRepo: ConanVirtualRepositoryConfig, &HelmLocalRepo: HelmLocalRepositoryConfig, - &HuggingFaceRemoteRepo: HuggingFaceRemoteRepositoryConfig, + &HuggingFaceLocalRepo: HuggingFaceLocalRepositoryConfig, &RtDebianRepo: DebianTestRepositoryConfig, &RtLfsRepo: GitLfsTestRepositoryConfig, &RtRepo1: Repo1RepositoryConfig, @@ -356,7 +356,7 @@ func GetNonVirtualRepositories() map[*string]string { TestPoetry: {&PoetryLocalRepo, &PoetryRemoteRepo}, TestConan: {&ConanLocalRepo, &ConanRemoteRepo}, TestHelm: {&HelmLocalRepo}, - TestHuggingFace: {&HuggingFaceRemoteRepo}, + TestHuggingFace: {&HuggingFaceLocalRepo}, TestPlugins: {&RtRepo1}, TestXray: {&NpmRemoteRepo, &NugetRemoteRepo, &YarnRemoteRepo, &GradleRemoteRepo, &MvnRemoteRepo, &GoRepo, &GoRemoteRepo, &PypiRemoteRepo}, TestAccess: {&RtRepo1}, @@ -486,7 +486,7 @@ func getSubstitutionMap() map[string]string { "${CONAN_REMOTE_REPO}": ConanRemoteRepo, "${CONAN_VIRTUAL_REPO}": ConanVirtualRepo, "${HELM_REPO}": HelmLocalRepo, - "${HUGGINGFACE_REMOTE_REPO}": HuggingFaceRemoteRepo, + "${HUGGINGFACE_LOCAL_REPO}": HuggingFaceLocalRepo, "${BUILD_NAME1}": RtBuildName1, "${BUILD_NAME2}": RtBuildName2, "${BUNDLE_NAME}": BundleName, @@ -556,7 +556,7 @@ func AddTimestampToGlobalVars() { ConanRemoteRepo += uniqueSuffix ConanVirtualRepo += uniqueSuffix HelmLocalRepo += uniqueSuffix - HuggingFaceRemoteRepo += uniqueSuffix + HuggingFaceLocalRepo += uniqueSuffix RtDebianRepo += uniqueSuffix RtLfsRepo += uniqueSuffix RtRepo1 += uniqueSuffix From 5c236d7c3a8e55b53b71365de57a1de327301d1e Mon Sep 17 00:00:00 2001 From: Naveen Kumar Date: Wed, 4 Mar 2026 01:30:17 +0530 Subject: [PATCH 5/8] Updated test cases for minor fixes --- buildtools/cli.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildtools/cli.go b/buildtools/cli.go index 997450f2c..dc0a4cccc 100644 --- a/buildtools/cli.go +++ b/buildtools/cli.go @@ -1163,7 +1163,7 @@ func huggingFaceUploadCmd(c *cli.Context, hfArgs []string) error { if repoID == "" { return cliutils.PrintHelpAndReturnError("Repository ID cannot be empty.", c) } - hfArgs, serverDetails, err := getHuggingFaceServerDetails(hfArgs) + _, serverDetails, err := getHuggingFaceServerDetails(hfArgs) if serverDetails == nil { return fmt.Errorf("no default server configuration found. Please configure a server using 'jfrog config add' or specify a server using --server-id") } @@ -1203,7 +1203,7 @@ func huggingFaceDownloadCmd(c *cli.Context, hfArgs []string) error { if repoID == "" { return cliutils.PrintHelpAndReturnError("Model/Dataset name cannot be empty.", c) } - hfArgs, serverDetails, err := getHuggingFaceServerDetails(hfArgs) + _, serverDetails, err := getHuggingFaceServerDetails(hfArgs) if serverDetails == nil { return fmt.Errorf("no default server configuration found. Please configure a server using 'jfrog config add' or specify a server using --server-id") } From ee59fc3f0dc3553ee0025da3c19151e2fe10b281 Mon Sep 17 00:00:00 2001 From: Kanishk Gupta Date: Tue, 3 Mar 2026 14:24:41 +0530 Subject: [PATCH 6/8] RTECO-928 - Support for docker 29 (#3374) # Conflicts: # go.mod --- .github/workflows/dockerTests.yml | 17 +++++++-- go.mod | 23 ++++++------- go.sum | 57 +++++++++++-------------------- utils/tests/container.go | 2 ++ 4 files changed, 47 insertions(+), 52 deletions(-) diff --git a/.github/workflows/dockerTests.yml b/.github/workflows/dockerTests.yml index af8639178..07d4bbbb4 100644 --- a/.github/workflows/dockerTests.yml +++ b/.github/workflows/dockerTests.yml @@ -16,13 +16,15 @@ concurrency: cancel-in-progress: true jobs: Docker-tests: - name: Docker tests (${{ matrix.os.name }}) + name: Docker tests (${{ matrix.os.name }}, containerd-snapshotter=${{ !matrix.disable-containerd-snapshotter }}) if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'safe to test') strategy: + fail-fast: false matrix: os: - name: ubuntu version: 24.04 + disable-containerd-snapshotter: [true, false] runs-on: ${{ matrix.os.name }}-${{ matrix.os.version }} steps: - name: Checkout code @@ -30,7 +32,8 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha || github.ref }} - - name: Configure Docker 29 for Legacy Support + - name: Configure Docker with legacy snapshotter + if: matrix.disable-containerd-snapshotter == true run: | sudo bash -c 'cat < /etc/docker/daemon.json { @@ -42,6 +45,16 @@ jobs: EOF' sudo systemctl restart docker + - name: Configure Docker with containerd snapshotter + if: matrix.disable-containerd-snapshotter == false + run: | + sudo bash -c 'cat < /etc/docker/daemon.json + { + "insecure-registries": ["localhost:8082"] + } + EOF' + sudo systemctl restart docker + - name: Setup FastCI uses: jfrog-fastci/fastci@v0 with: diff --git a/go.mod b/go.mod index 0f9fd798a..e929c9cc0 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/jfrog/build-info-go v1.13.1-0.20260216093441-40a4dc563294 github.com/jfrog/gofrog v1.7.6 github.com/jfrog/jfrog-cli-application v1.0.2-0.20260216085810-1ade6c26b3df - github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260303052518-917c005de223 + github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260303081233-aefbc2d40c47 github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260218080258-3bf55ed18973 github.com/jfrog/jfrog-cli-evidence v0.8.3-0.20260202100913-d9ee9476845a github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20260213131956-d1d39bf3a042 @@ -29,7 +29,7 @@ require ( github.com/manifoldco/promptui v0.9.0 github.com/spf13/viper v1.21.0 github.com/stretchr/testify v1.11.1 - github.com/testcontainers/testcontainers-go v0.35.0 + github.com/testcontainers/testcontainers-go v0.40.0 github.com/urfave/cli v1.22.17 github.com/xeipuuv/gojsonschema v1.2.0 golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a @@ -40,7 +40,6 @@ require ( require ( cloud.google.com/go/auth v0.18.1 // indirect dario.cat/mergo v1.0.2 // indirect - github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 // indirect github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/CycloneDX/cyclonedx-go v0.10.0 // indirect github.com/Masterminds/semver/v3 v3.4.0 // indirect @@ -61,6 +60,7 @@ require ( github.com/cloudflare/circl v1.6.3 // indirect github.com/containerd/containerd v1.7.29 // indirect github.com/containerd/errdefs v1.0.0 // indirect + github.com/containerd/errdefs/pkg v0.3.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/platforms v0.2.1 // indirect github.com/containerd/stargz-snapshotter/estargz v0.18.1 // indirect @@ -75,9 +75,10 @@ require ( github.com/docker/cli v29.0.3+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker-credential-helpers v0.9.3 // indirect - github.com/docker/go-connections v0.5.0 // indirect + github.com/docker/go-connections v0.6.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect + github.com/ebitengine/purego v0.8.4 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect @@ -112,7 +113,6 @@ require ( github.com/go-openapi/swag/yamlutils v0.25.4 // indirect github.com/go-openapi/validate v0.25.1 // indirect github.com/go-viper/mapstructure/v2 v2.5.0 // indirect - github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.5.2 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -155,6 +155,7 @@ require ( github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect + github.com/moby/go-archive v0.1.0 // indirect github.com/moby/patternmatcher v0.6.0 // indirect github.com/moby/sys/sequential v0.6.0 // indirect github.com/moby/sys/user v0.4.0 // indirect @@ -183,8 +184,7 @@ require ( github.com/secure-systems-lab/go-securesystemslib v0.10.0 // indirect github.com/sergi/go-diff v1.4.0 // indirect github.com/shibumi/go-pathspec v1.3.0 // indirect - github.com/shirou/gopsutil/v3 v3.23.12 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.25.6 // indirect github.com/sigstore/protobuf-specs v0.5.0 // indirect github.com/sigstore/rekor v1.5.0 // indirect github.com/sigstore/rekor-tiles/v2 v2.1.0 // indirect @@ -213,7 +213,7 @@ require ( github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect - github.com/yusufpapurcu/wmi v1.2.3 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect go.mongodb.org/mongo-driver v1.17.7 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0 // indirect @@ -243,22 +243,19 @@ require ( google.golang.org/protobuf v1.36.11 // indirect gopkg.in/ini.v1 v1.67.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect - gotest.tools/v3 v3.5.2 // indirect helm.sh/helm/v3 v3.19.2 // indirect k8s.io/client-go v0.34.0 // indirect oras.land/oras-go/v2 v2.6.0 // indirect sigs.k8s.io/yaml v1.6.0 // indirect ) -replace github.com/docker/docker => github.com/docker/docker v27.5.1+incompatible - replace github.com/gfleury/go-bitbucket-v1 => github.com/gfleury/go-bitbucket-v1 v0.0.0-20230825095122-9bc1711434ab replace github.com/ktrysmt/go-bitbucket => github.com/ktrysmt/go-bitbucket v0.9.80 -// replace github.com/jfrog/jfrog-cli-artifactory => github.com/reshmifrog/jfrog-cli-artifactory v0.0.0-20260302170823-db801936b182 +//replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core -//replace github.com/jfrog/jfrog-cli-artifactory => /Users/naveenku/Desktop/eco-matrix/jfrog-cli-artifactory +// replace github.com/jfrog/jfrog-cli-artifactory => github.com/fluxxBot/jfrog-cli-artifactory v0.0.0-20260130044429-464a5025d08a //replace github.com/jfrog/build-info-go => github.com/fluxxBot/build-info-go v1.10.10-0.20260105070825-d3f36f619ba5 diff --git a/go.sum b/go.sum index 76385b282..3bd696dc1 100644 --- a/go.sum +++ b/go.sum @@ -139,6 +139,8 @@ github.com/containerd/containerd v1.7.29 h1:90fWABQsaN9mJhGkoVnuzEY+o1XDPbg9BTC9 github.com/containerd/containerd v1.7.29/go.mod h1:azUkWcOvHrWvaiUjSQH0fjzuHIwSPg1WL5PshGP4Szs= github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= +github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= +github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= @@ -183,12 +185,12 @@ github.com/docker/cli v29.0.3+incompatible h1:8J+PZIcF2xLd6h5sHPsp5pvvJA+Sr2wGQx github.com/docker/cli v29.0.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v27.5.1+incompatible h1:4PYU5dnBYqRQi0294d1FBECqT9ECWeQAIfE8q4YnPY8= -github.com/docker/docker v27.5.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.5.2+incompatible h1:DBX0Y0zAjZbSrm1uzOkdr1onVghKaftjlSWt4AFexzM= +github.com/docker/docker v28.5.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= -github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= -github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= +github.com/docker/go-connections v0.6.0 h1:LlMG9azAe1TqfR7sO+NJttz1gy6KO7VJBh+pMmjSD94= +github.com/docker/go-connections v0.6.0/go.mod h1:AahvXYshr6JgfUJGdDCs2b5EZG/vmaMAntpSFH5BFKE= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= @@ -198,6 +200,8 @@ github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 h1:2tV76y6Q9BB+NEBasnqvs7e49aEBFI8ejC89PSnWH+4= github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= +github.com/ebitengine/purego v0.8.4 h1:CF7LEKg5FFOsASUj0+QwaXf8Ht6TlFxg09+S9wz0omw= +github.com/ebitengine/purego v0.8.4/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o= github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= @@ -295,8 +299,6 @@ github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1 h1:FWNFq4fM1wPfcK40 github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1/go.mod h1:5YoVOkjYAQumqlV356Hj3xeYh4BdZuLE0/nRkf2NKkI= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI= github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= @@ -417,8 +419,8 @@ github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYL github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w= github.com/jfrog/jfrog-cli-application v1.0.2-0.20260216085810-1ade6c26b3df h1:raSyae8/h1y8HtzFLf7vZZj91fP/qD94AX+biwBJiqs= github.com/jfrog/jfrog-cli-application v1.0.2-0.20260216085810-1ade6c26b3df/go.mod h1:xum2HquWO5uExa/A7MQs3TgJJVEeoqTR+6Z4mfBr1Xw= -github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260303052518-917c005de223 h1:amcFRt9xKmWZBsoT++amBoGrHiF28lTbWqr5yxHz+dI= -github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260303052518-917c005de223/go.mod h1:P9ZywyTQzp+WsNmeb4IiMQOdVb++eQUD5oXd18LRVj8= +github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260303081233-aefbc2d40c47 h1:sVnpvQhg+jGkd8Vvww3+z+DZS3UBFi+0qCUKl6jKOmk= +github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260303081233-aefbc2d40c47/go.mod h1:IRUe9nYwCUq8V2WRDUd4bddwiXXdkxvNQ36+0U0uHqI= github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260218080258-3bf55ed18973 h1:fOlWUGkCuujnIcE3166gpTdvicwv1wAZhLrfbm+f6rY= github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260218080258-3bf55ed18973/go.mod h1:GDveG1xAoiM12JlSx8RE0OcJ6Ov+xcmpmGv84we3pMA= github.com/jfrog/jfrog-cli-evidence v0.8.3-0.20260202100913-d9ee9476845a h1:lTOAhUjKcOmM/0Kbj4V+I/VHPlW7YNAhIEVpGnCM5mI= @@ -439,8 +441,6 @@ github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q github.com/k0kubun/pp v3.0.1+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= github.com/kevinburke/ssh_config v1.4.0 h1:6xxtP5bZ2E4NF5tuQulISpTO2z8XbtH8cg1PWkxoFkQ= github.com/kevinburke/ssh_config v1.4.0/go.mod h1:q2RIzfka+BXARoNexmF9gkxEX7DmvbW9P4hIVx2Kg4M= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c= github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= @@ -504,8 +504,12 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= +github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ= +github.com/moby/go-archive v0.1.0/go.mod h1:G9B+YoujNohJmrIYFBpSd54GTUB4lt9S+xVQvsJyFuo= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= +github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw= +github.com/moby/sys/atomicwriter v0.1.0/go.mod h1:Ul8oqv2ZMNHOceF643P6FKPXeCmYtlQMvpizfsSoaWs= github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU= github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko= github.com/moby/sys/user v0.4.0 h1:jhcMKit7SA80hivmFJcbB1vqmw//wU61Zdui2eQXuMs= @@ -596,12 +600,8 @@ github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw= github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI= github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE= -github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4= -github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= -github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +github.com/shirou/gopsutil/v4 v4.25.6 h1:kLysI2JsKorfaFPcYmcJqbzROzsBWEOAtw6A7dIfqXs= +github.com/shirou/gopsutil/v4 v4.25.6/go.mod h1:PfybzyydfZcN+JMMjkF6Zb8Mq1A/VcogFFg7hj50W9c= github.com/sigstore/protobuf-specs v0.5.0 h1:F8YTI65xOHw70NrvPwJ5PhAzsvTnuJMGLkA4FIkofAY= github.com/sigstore/protobuf-specs v0.5.0/go.mod h1:+gXR+38nIa2oEupqDdzg4qSBT0Os+sP7oYv6alWewWc= github.com/sigstore/rekor v1.5.0 h1:rL7SghHd5HLCtsCrxw0yQg+NczGvM75EjSPPWuGjaiQ= @@ -659,8 +659,8 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/terminalstatic/go-xsd-validate v0.1.6 h1:TenYeQ3eY631qNi1/cTmLH/s2slHPRKTTHT+XSHkepo= github.com/terminalstatic/go-xsd-validate v0.1.6/go.mod h1:18lsvYFofBflqCrvo1umpABZ99+GneNTw2kEEc8UPJw= -github.com/testcontainers/testcontainers-go v0.35.0 h1:uADsZpTKFAtp8SLK+hMwSaa+X+JiERHtd4sQAFmXeMo= -github.com/testcontainers/testcontainers-go v0.35.0/go.mod h1:oEVBj5zrfJTrgjwONs1SsRbnBtH9OKl+IGl3UMcr2B4= +github.com/testcontainers/testcontainers-go v0.40.0 h1:pSdJYLOVgLE8YdUY2FHQ1Fxu+aMnb6JfVz1mxk7OeMU= +github.com/testcontainers/testcontainers-go v0.40.0/go.mod h1:FSXV5KQtX2HAMlm7U3APNyLkkap35zNLxukw9oBi/MY= github.com/theupdateframework/go-tuf v0.7.0 h1:CqbQFrWo1ae3/I0UCblSbczevCCbS31Qvs5LdxRWqRI= github.com/theupdateframework/go-tuf v0.7.0/go.mod h1:uEB7WSY+7ZIugK6R1hiBMBjQftaFzn7ZCDJcp1tCUug= github.com/theupdateframework/go-tuf/v2 v2.4.0 h1:3HGxV0lq91/RJ7YycqCKuKBuLfo4rLRut4lh9XqIEP4= @@ -711,11 +711,9 @@ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavM github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= -github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zalando/go-keyring v0.2.3 h1:v9CUu9phlABObO4LPWycf+zwMG7nlbb3t/B5wa97yms= github.com/zalando/go-keyring v0.2.3/go.mod h1:HL4k+OXQfJUWaMnqyuSOc0drfGPX2b51Du6K+MRgZMk= go.mongodb.org/mongo-driver v1.17.7 h1:a9w+U3Vt67eYzcfq3k/OAv284/uUUkL0uP75VE5rCOU= @@ -783,8 +781,6 @@ go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= @@ -793,18 +789,13 @@ golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a h1:ovFr6Z0MNmU7nH8VaX5xqw+05ST2uO1exVfZPVqRC5o= golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a/go.mod h1:K79w1Vqn7PoiZn+TkNpx3BUWUQksGO3JcVX6qIjytmA= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -822,7 +813,6 @@ golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwE golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= @@ -830,7 +820,6 @@ golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -839,7 +828,6 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -859,7 +847,6 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= @@ -885,16 +872,12 @@ golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k= golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= google.golang.org/api v0.262.0 h1:4B+3u8He2GwyN8St3Jhnd3XRHlIvc//sBmgHSp78oNY= diff --git a/utils/tests/container.go b/utils/tests/container.go index b94f3d682..253a3e410 100644 --- a/utils/tests/container.go +++ b/utils/tests/container.go @@ -103,7 +103,9 @@ func (c *ContainerRequest) Remove() *ContainerRequest { // Mounts the 'hostPath' working directory from localhost into the container. func (c *ContainerRequest) Mount(mounts ...mount.Mount) *ContainerRequest { + req := &c.request c.request.HostConfigModifier = func(cfg *container.HostConfig) { + cfg.Privileged = req.Privileged if cfg.Mounts == nil { cfg.Mounts = make([]mount.Mount, 0) } From 2971ade65bd65a3dac7edb7ebd13dffe0bbc0f03 Mon Sep 17 00:00:00 2001 From: Naveen Kumar Date: Tue, 3 Mar 2026 12:52:30 +0530 Subject: [PATCH 7/8] Added logic for updating HF_ENDPOINT and HF_TOKEN from default or specific server details itself # Conflicts: # go.mod # go.sum --- buildtools/cli.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildtools/cli.go b/buildtools/cli.go index dc0a4cccc..997450f2c 100644 --- a/buildtools/cli.go +++ b/buildtools/cli.go @@ -1163,7 +1163,7 @@ func huggingFaceUploadCmd(c *cli.Context, hfArgs []string) error { if repoID == "" { return cliutils.PrintHelpAndReturnError("Repository ID cannot be empty.", c) } - _, serverDetails, err := getHuggingFaceServerDetails(hfArgs) + hfArgs, serverDetails, err := getHuggingFaceServerDetails(hfArgs) if serverDetails == nil { return fmt.Errorf("no default server configuration found. Please configure a server using 'jfrog config add' or specify a server using --server-id") } @@ -1203,7 +1203,7 @@ func huggingFaceDownloadCmd(c *cli.Context, hfArgs []string) error { if repoID == "" { return cliutils.PrintHelpAndReturnError("Model/Dataset name cannot be empty.", c) } - _, serverDetails, err := getHuggingFaceServerDetails(hfArgs) + hfArgs, serverDetails, err := getHuggingFaceServerDetails(hfArgs) if serverDetails == nil { return fmt.Errorf("no default server configuration found. Please configure a server using 'jfrog config add' or specify a server using --server-id") } From 764a8289111f3b0657aa156ed228e97524bbf930 Mon Sep 17 00:00:00 2001 From: Naveen Kumar Date: Wed, 4 Mar 2026 01:44:43 +0530 Subject: [PATCH 8/8] Updated test cases's static failures --- buildtools/cli.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/buildtools/cli.go b/buildtools/cli.go index 997450f2c..f90525d12 100644 --- a/buildtools/cli.go +++ b/buildtools/cli.go @@ -1163,9 +1163,9 @@ func huggingFaceUploadCmd(c *cli.Context, hfArgs []string) error { if repoID == "" { return cliutils.PrintHelpAndReturnError("Repository ID cannot be empty.", c) } - hfArgs, serverDetails, err := getHuggingFaceServerDetails(hfArgs) - if serverDetails == nil { - return fmt.Errorf("no default server configuration found. Please configure a server using 'jfrog config add' or specify a server using --server-id") + serverDetails, err := getHuggingFaceServerDetails(hfArgs) + if err != nil { + return err } err = updateHuggingFaceEnv(c, serverDetails) if err != nil { @@ -1203,9 +1203,9 @@ func huggingFaceDownloadCmd(c *cli.Context, hfArgs []string) error { if repoID == "" { return cliutils.PrintHelpAndReturnError("Model/Dataset name cannot be empty.", c) } - hfArgs, serverDetails, err := getHuggingFaceServerDetails(hfArgs) - if serverDetails == nil { - return fmt.Errorf("no default server configuration found. Please configure a server using 'jfrog config add' or specify a server using --server-id") + serverDetails, err := getHuggingFaceServerDetails(hfArgs) + if err != nil { + return err } err = updateHuggingFaceEnv(c, serverDetails) if err != nil { @@ -1240,26 +1240,26 @@ func huggingFaceDownloadCmd(c *cli.Context, hfArgs []string) error { return commands.Exec(huggingFaceDownloadCmd) } -func getHuggingFaceServerDetails(args []string) ([]string, *coreConfig.ServerDetails, error) { - cleanedArgs, serverID, err := coreutils.ExtractServerIdFromCommand(args) +func getHuggingFaceServerDetails(args []string) (*coreConfig.ServerDetails, error) { + _, serverID, err := coreutils.ExtractServerIdFromCommand(args) if err != nil { - return nil, nil, fmt.Errorf("failed to extract server ID: %w", err) + return nil, fmt.Errorf("failed to extract server ID: %w", err) } if serverID == "" { serverDetails, err := coreConfig.GetDefaultServerConf() if err != nil { - return cleanedArgs, nil, err + return nil, err } if serverDetails == nil { - return cleanedArgs, nil, fmt.Errorf("no default server configuration found. Please configure a server using 'jfrog config add' or specify a server using --server-id") + return nil, fmt.Errorf("no default server configuration found. Please configure a server using 'jfrog config add' or specify a server using --server-id") } - return cleanedArgs, serverDetails, nil + return serverDetails, nil } serverDetails, err := coreConfig.GetSpecificConfig(serverID, true, true) if err != nil { - return nil, nil, fmt.Errorf("failed to get server configuration for ID '%s': %w", serverID, err) + return nil, fmt.Errorf("failed to get server configuration for ID '%s': %w", serverID, err) } - return cleanedArgs, serverDetails, nil + return serverDetails, nil } func updateHuggingFaceEnv(c *cli.Context, serverDetails *coreConfig.ServerDetails) error {