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]: src/system/os.py does not correctly return architecture for bsd platform #3236

Closed
peterzhuamazon opened this issue Feb 23, 2023 · 2 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Feb 23, 2023

Describe the bug

Run uname -m will return follow in the freebsd:

amd64

The code here does not support amd64 as input:
https://github.com/opensearch-project/opensearch-build/blob/main/src/system/os.py#L12-L19

def current_architecture() -> str:
    architecture = subprocess.check_output(["uname", "-m"]).decode().strip()
    if architecture == "x86_64":
        return "x64"
    elif architecture == "aarch64" or architecture == "arm64":
        return "arm64"
    else:
        raise ValueError(f"Unsupported architecture: {architecture}")

Thanks.

To reproduce

Run the build process on a freebsd server and see output:

$ ./build.sh manifests/2.4.0/opensearch-2.4.0.yml --component OpenSearch
Installing dependencies in . ...
Installing dependencies from Pipfile.lock (b36c9c)...
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.4.0/opensearch-2.4.0.yml --component OpenSearch ...
2023-02-23 23:15:47 INFO     Building in /tmp/tmpllimwxjs
2023-02-23 23:15:47 INFO     Removing /tmp/tmpllimwxjs
Traceback (most recent call last):
  File "./src/run_build.py", line 81, in <module>
    sys.exit(main())
  File "./src/run_build.py", line 55, in main
    architecture=args.architecture or manifest.build.architecture,
  File "/usr/share/opensearch/opensearch-build/src/build_workflow/build_target.py", line 45, in __init__
    self.architecture = architecture or current_architecture()
  File "/usr/share/opensearch/opensearch-build/src/system/os.py", line 20, in current_architecture
    raise ValueError(f"Unsupported architecture: {architecture}")
ValueError: Unsupported architecture: amd64

Expected behavior

The bsd x64 hosts can run the code without specifying --architecture x64.

Screenshots

If applicable, add screenshots to help explain your problem.

Host / Environment

No response

Additional context

No response

Relevant log output

No response

@peterzhuamazon peterzhuamazon added bug Something isn't working untriaged Issues that have not yet been triaged good first issue Good for newcomers and removed untriaged Issues that have not yet been triaged labels Feb 23, 2023
@peterzhuamazon peterzhuamazon self-assigned this Feb 23, 2023
@github-actions github-actions bot added the untriaged Issues that have not yet been triaged label Feb 23, 2023
@peterzhuamazon peterzhuamazon changed the title [Bug]: src/system/os.py does not correct return architecture for bsd platform [Bug]: src/system/os.py does not correctly return architecture for bsd platform Feb 24, 2023
@peterzhuamazon peterzhuamazon removed the untriaged Issues that have not yet been triaged label Feb 24, 2023
@jordarlu
Copy link
Contributor

jordarlu commented Apr 4, 2023

Hello, @peterzhuamazon ...as you have the PR merged, do you think we can close this issue? Thanks !!

@peterzhuamazon
Copy link
Member Author

Closing now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants