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

[Bug]: The ref in the manifest is considered as a float rather than a string if branch name is 2.17. #5061

Closed
navneet1v opened this issue Sep 28, 2024 · 3 comments
Labels
bug Something isn't working untriaged Issues that have not yet been triaged

Comments

@navneet1v
Copy link
Contributor

navneet1v commented Sep 28, 2024

Describe the bug

The ref in the manifest is considered as a float rather than a string if branch name is 2.17.

Below are the logs I saw when I used 2.17 for a repo like Opensearch/k-NN:

✔ Successfully created virtual environment!
Virtualenv location: /home/ci-runner/.local/share/virtualenvs/opensearch-build-udCjdOuE
Installing dependencies from Pipfile.lock (6b098c)...
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
Running ./src/run_build.py manifests/2.17.0/opensearch-2.17.0.yml --component OpenSearch k-NN -a arm64 --continue-on-error -d tar ...
Traceback (most recent call last):
  File "/home/ci-runner/opensearch-build/./src/run_build.py", line 113, in <module>
    sys.exit(main())
  File "/home/ci-runner/opensearch-build/./src/run_build.py", line 29, in main
    manifest = InputManifest.from_file(args.manifest)
  File "/home/ci-runner/opensearch-build/src/manifests/manifest.py", line 36, in from_file
    return loader(yml)
  File "/home/ci-runner/opensearch-build/src/manifests/input_manifest.py", line 113, in __init__
    super().__init__(data)
  File "/home/ci-runner/opensearch-build/src/manifests/component_manifest.py", line 31, in __init__
    super().__init__(data)
  File "/home/ci-runner/opensearch-build/src/manifests/manifest.py", line 112, in __init__
    self.validate(data)
  File "/home/ci-runner/opensearch-build/src/manifests/manifest.py", line 122, in validate
    raise ValueError(f"Invalid manifest schema: {v.errors}")
ValueError: Invalid manifest schema: {'components': [{4: ['no definitions validate', {'anyof definition 0': [{'ref': ['must be of string type']}], 'anyof definition 1': [{'dist': ['required field'], 'ref': ['unknown field'], 'repository': ['unknown field']}]}]}]}

To reproduce

Setup the build containers and checkout the opensearch-build.

Now try to build the version let say 2.17 by changing the branch of the repo say k-NN to 2.17.

run the command:

./build.sh manifests/2.17.0/opensearch-2.17.0.yml --component OpenSearch k-NN -a arm64 --continue-on-error -d tar

You will get the below error


✔ Successfully created virtual environment!
Virtualenv location: /home/ci-runner/.local/share/virtualenvs/opensearch-build-udCjdOuE
Installing dependencies from Pipfile.lock (6b098c)...
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
Running ./src/run_build.py manifests/2.17.0/opensearch-2.17.0.yml --component OpenSearch k-NN -a arm64 --continue-on-error -d tar ...
Traceback (most recent call last):
  File "/home/ci-runner/opensearch-build/./src/run_build.py", line 113, in <module>
    sys.exit(main())
  File "/home/ci-runner/opensearch-build/./src/run_build.py", line 29, in main
    manifest = InputManifest.from_file(args.manifest)
  File "/home/ci-runner/opensearch-build/src/manifests/manifest.py", line 36, in from_file
    return loader(yml)
  File "/home/ci-runner/opensearch-build/src/manifests/input_manifest.py", line 113, in __init__
    super().__init__(data)
  File "/home/ci-runner/opensearch-build/src/manifests/component_manifest.py", line 31, in __init__
    super().__init__(data)
  File "/home/ci-runner/opensearch-build/src/manifests/manifest.py", line 112, in __init__
    self.validate(data)
  File "/home/ci-runner/opensearch-build/src/manifests/manifest.py", line 122, in validate
    raise ValueError(f"Invalid manifest schema: {v.errors}")
ValueError: Invalid manifest schema: {'components': [{4: ['no definitions validate', {'anyof definition 0': [{'ref': ['must be of string type']}], 'anyof definition 1': [{'dist': ['required field'], 'ref': ['unknown field'], 'repository': ['unknown field']}]}]}]}

Expected behavior

The build should work. There should be no constraint on what is the branch name.

Screenshots

If applicable, add screenshots to help explain your problem.

Host / Environment

Docker image : opensearchstaging/ci-runner:ci-runner-al2-opensearch-build-v1 on the arm machine

Additional context

I was trying to build my own distribution for testing some changes and then I encountered this issue.

Relevant log output

Added already.
@navneet1v navneet1v added bug Something isn't working untriaged Issues that have not yet been triaged labels Sep 28, 2024
@prudhvigodithi
Copy link
Collaborator

@navneet1v here is an example https://github.com/opensearch-project/opensearch-build/pull/4873/files, we should use
ref: '2.17'.
Adding @peterzhuamazon @gaiksaya

@navneet1v
Copy link
Contributor Author

Make sense. So I just need to add ''. Thanks a lot. :)

@peterzhuamazon
Copy link
Member

Close as yaml can treat non-quoted float value as float type.

Thanks.

@peterzhuamazon peterzhuamazon changed the title [Bug]: The [Bug]: The ref in the manifest is considered as a float rather than a string if branch name is 2.17. Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged Issues that have not yet been triaged
Projects
Status: ✅ Done
Development

No branches or pull requests

3 participants