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

lower limit at which we start shortening filenames for variant configs #2233

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

h-vetinari
Copy link
Member

This was proposed by Isuru here. I don't know where the limit on the windows server from prefix is coming from, normally filenames until 260 characters should be fine, but it still fails in conda-forge/pytorch-cpu-feedstock#332 (which has been rerendered with the changes this PR) with

Checking out the ref
  "C:\Program Files\Git\bin\git.exe" checkout --progress --force refs/remotes/pull/332/merge
  Error: error: unable to create file .ci_support/linux_64_blas_implgenericc_compiler_version13channel_targetsconda-forge_maincuda_compilerNonecuda_compiler_versionNonecxx_compiler_version13github_actions_labelscirun-openstack-cpu-2xlargeis_h2ab6b548.yaml: Filename too long
  Error: error: unable to create file .ci_support/linux_64_blas_implgenericc_compiler_version13channel_targetsconda-forge_maincuda_compilerNonecuda_compiler_versionNonecxx_compiler_version13github_actions_labelscirun-openstack-gpu-2xlargeis_h6173e25b.yaml: Filename too long

On the other hand, I don't want to shorten the config names too much, because then we lose a lot of information which is relevant for the pytorch/tensorflow feedstocks, like is this a CPU or GPU job (doubly so if we'd take the doubled CI as in conda-forge/pytorch-cpu-feedstock#332), and it's not desirable to just too-short filenames that are only distinguishable by hashes, where one has no idea which exact config is behind when looking at the actions UI.

but don't just take the short_config_name, which is too short to distinguish
the file names of the respective builds (e.g. CPU vs. CUDA)
short_config_name = config_name[:35] + "_h" + h
if len("conda-forge-build-done-" + config_name) >= 250:
short_config_name = config_name[:40] + "_h" + salt
if len("conda-forge-build-done-" + config_name) >= 200:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if len("conda-forge-build-done-" + config_name) >= 200:
if len(config_name) >= 190:

Copy link
Member Author

Choose a reason for hiding this comment

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

Doesn't this need to take into account something like

C:\Users\runnerx\_work\pytorch-cpu-feedstock\pytorch-cpu-feedstock\.ci_support\

(not sure where you got that from, and why the pytorch-cpu-feedstock is doubled), then we can directly check >=260.

@@ -791,12 +791,13 @@ def dump_subspace_config_files(
package_key(config, top_level_loop_vars, metas[0].config.subdir),
)
short_config_name = config_name
salt = hashlib.sha256(config_name.encode("utf-8")).hexdigest()[:8]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
salt = hashlib.sha256(config_name.encode("utf-8")).hexdigest()[:8]
hash = hashlib.sha256(config_name.encode("utf-8")).hexdigest()[:8]

Copy link
Member

@isuruf isuruf left a comment

Choose a reason for hiding this comment

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

This looks like a reasonable change to me

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