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

omnitrace-install.py #221

Merged
merged 1 commit into from
Dec 16, 2022
Merged

Conversation

jrmadsen
Copy link
Collaborator

  • omnitrace-install.py will be uploaded as a release asset
  • script simplifies selecting the correct installer script

Docker Example

ARG OMNITRACE_VERSION=latest
ARG ROCM_VERSION=5.3

RUN wget https://github.com/AMDResearch/omnitrace/releases/download/${OMNITRACE_VERSION}/omnitrace-install.py && \
    python3 omnitrace-install.py --rocm ${ROCM_VERSION} && \
    rm omnitrace-install.py

Options

$ python3 omnitrace-install.py --help
usage: omnitrace-install.py [-h] [--version] [-p PREFIX] [-i]
                            [-D DOWNLOAD_PATH] [-d {auto,ubuntu,opensuse}]
                            [-v OS_VERSION] [-k]
                            [--rocm [VERSION or ROCM_PATH with .info/version files]]
                            [-e [{papi,ompt,python3} [{papi,ompt,python3} ...]]]

optional arguments:
  -h, --help            show this help message and exit
  --version             Print omnitrace version which will be installed
  -p PREFIX, --prefix PREFIX
                        Installation prefix
  -i, --interactive     Prompt to accept the license and include/exclude
                        subdirectory
  -D DOWNLOAD_PATH, --download-path DOWNLOAD_PATH
                        Download directory (default: temporary directory)
  -d {auto,ubuntu,opensuse}, --os-distrib {auto,ubuntu,opensuse}
                        Target OS distribution
  -v OS_VERSION, --os-version OS_VERSION
                        Target OS version
  -k, --keep-download   Do not delete downloaded file as installation
  --rocm [VERSION or ROCM_PATH with .info/version file(s)]
                        Install omnitrace with ROCm support. Accepts either a
                        ROCm version (e.g. '5.4') or the root path to the ROCm
                        install containing .info/version* file(s) (e.g.
                        /opt/rocm if /opt/rocm/.info/version exists). If no
                        argument is provided, the ROCm version will attempted
                        to be deduced from $ENV{ROCM_PATH}/.info/version
  -e [{papi,ompt,python3} [{papi,ompt,python3} ...]], --extensions [{papi,ompt,python3} [{papi,ompt,python3} ...]]
                        Omnitrace extensions, e.g. PAPI, OMPT, and Python3

Usage Example

$ python3 omnitrace-install.py -p /usr/local/omnitrace --rocm 5.2
### Downloading https://github.com/AMDResearch/omnitrace/releases/download/v1.7.3/omnitrace-1.7.3-ubuntu-18.04-ROCm-50200-PAPI-OMPT-Python3.sh ...
### Download completed: /tmp/omnitrace-install-tjibafo7/omnitrace-1.7.3-ubuntu-18.04-ROCm-50200-PAPI-OMPT-Python3.sh
### Creating directory: /usr/local/omnitrace ...
### Installing omnitrace to /usr/local/omnitrace ...
### Executing: /tmp/omnitrace-install-tjibafo7/omnitrace-1.7.3-ubuntu-18.04-ROCm-50200-PAPI-OMPT-Python3.sh --prefix=/usr/local/omnitrace --exclude-subdir --skip-license

omnitrace Installer Version: 1.7.3, Copyright (c) Advanced Micro Devices, Inc.
This is a self-extracting archive.
The archive will be extracted to: /usr/local/omnitrace

Using target directory: /usr/local/omnitrace
Extracting, please wait...

Unpacking finished successfully

### omnitrace v1.7.3 installation to /usr/local/omnitrace succeeded!
### Removing install script /tmp/omnitrace-install-tjibafo7/omnitrace-1.7.3-ubuntu-18.04-ROCm-50200-PAPI-OMPT-Python3.sh ...
### Removing temporary directory /tmp/omnitrace-install-tjibafo7 ...

@jrmadsen jrmadsen added the cpack Modifies the CPack packaging system label Dec 14, 2022
@jrmadsen jrmadsen force-pushed the omnitrace-install-python-script branch from 16ef2e9 to 7a2dc07 Compare December 14, 2022 09:17
- omnitrace-install.py will be uploaded as a release asset
- script simplifies selecting the correct installer script
@jrmadsen jrmadsen force-pushed the omnitrace-install-python-script branch from 7a2dc07 to 186f750 Compare December 14, 2022 14:00
@jrmadsen jrmadsen merged commit 1f81805 into ROCm:main Dec 16, 2022
@jrmadsen jrmadsen deleted the omnitrace-install-python-script branch December 16, 2022 11:31
jrmadsen added a commit to jrmadsen/omnitrace that referenced this pull request Feb 2, 2023
- omnitrace-install.py will be uploaded as a release asset
- script simplifies selecting the correct installer script
jrmadsen added a commit to jrmadsen/omnitrace that referenced this pull request Feb 2, 2023
- omnitrace-install.py will be uploaded as a release asset
- script simplifies selecting the correct installer script
@gsitaram
Copy link

@jrmadsen, the command below fails because there is no link called "latest" in that path. I've had to use "v1.8.0" explicitly to have this work.
Fails:

$ export OMNITRACE_VERSION=latest
$ wget https://github.com/AMDResearch/omnitrace/releases/download/${OMNITRACE_VERSION}/omnitrace-install.py

Works:

$ export OMNITRACE_VERSION=v1.8.0
$ wget https://github.com/AMDResearch/omnitrace/releases/download/${OMNITRACE_VERSION}/omnitrace-install.py

@gsitaram
Copy link

And when I tried the python script, I saw the following errors:

$ export OMNITRACE_INSTALL_DIR=/my/path/to/install
$ python3 omnitrace-install.py -p ${OMNITRACE_INSTALL_DIR} --rocm ${ROCM_PATH}​
Traceback (most recent call last):
  File "omnitrace-install.py", line 170, in <module>
    os_distrib, os_version = get_os_info(args.os_distrib, args.os_version)
  File "omnitrace-install.py", line 62, in get_os_info
    _key, _data = line.split("=", 1)
ValueError: not enough values to unpack (expected 2, got 1)

Could you help clarify?

@jrmadsen
Copy link
Collaborator Author

jrmadsen commented Mar 14, 2023

wget https://github.com/AMDResearch/omnitrace/releases/latest/download/omnitrace-install.py

So I got it wrong, "latest" needs to come before download for that to work.

@jrmadsen
Copy link
Collaborator Author

And when I tried the python script, I saw the following errors:

$ export OMNITRACE_INSTALL_DIR=/my/path/to/install
$ python3 omnitrace-install.py -p ${OMNITRACE_INSTALL_DIR} --rocm ${ROCM_PATH}​
Traceback (most recent call last):
  File "omnitrace-install.py", line 170, in <module>
    os_distrib, os_version = get_os_info(args.os_distrib, args.os_version)
  File "omnitrace-install.py", line 62, in get_os_info
    _key, _data = line.split("=", 1)
ValueError: not enough values to unpack (expected 2, got 1)

Could you help clarify?

Can you post the contents of /etc/os-release for the system you are trying to install on?

@gsitaram
Copy link

And when I tried the python script, I saw the following errors:

$ export OMNITRACE_INSTALL_DIR=/my/path/to/install
$ python3 omnitrace-install.py -p ${OMNITRACE_INSTALL_DIR} --rocm ${ROCM_PATH}​
Traceback (most recent call last):
  File "omnitrace-install.py", line 170, in <module>
    os_distrib, os_version = get_os_info(args.os_distrib, args.os_version)
  File "omnitrace-install.py", line 62, in get_os_info
    _key, _data = line.split("=", 1)
ValueError: not enough values to unpack (expected 2, got 1)

Could you help clarify?

Can you post the contents of /etc/os-release for the system you are trying to install on?

NAME="Red Hat Enterprise Linux"
VERSION="8.7 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.7"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.7 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.7
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.7"

@jrmadsen
Copy link
Collaborator Author

jrmadsen commented Mar 14, 2023

Ah, it's that blank line that's causing the error. But v1.8.0 doesn't have installers for RedHat. That will be available in v1.9.0 -- I just need to merge #257 (which should be done in the next hour or two) and fix this bug and I'll generate a release.

@gsitaram
Copy link

Okay perfect, thank you for your prompt response @jrmadsen !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cpack Modifies the CPack packaging system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants