How to Resolve the 'grep: /root/.ngc/config: No such file or directory' Error When Running the 'launch.sh' File

Hello community,

I encountered a challenge with the ‘launch.sh’ file during the BioNeMo installation process. I created a blank file using the $ sudo nano launch.sh command at this path (/home/ubuntu) and pasted the script into it.
Script source: Quickstart Guide — NVIDIA BioNeMo Framework

BIONEMO_IMAGE=nvcr.io/nvidia/clara/bionemo-framework:1.1               # Container with tag
LOCAL_REPO_PATH=$(pwd) # This needs to be set to BIONEMO_HOME for local (non-dockerized) use
DOCKER_REPO_PATH=/workspace/bionemo # This is set to BIONEMO_HOME in container
LOCAL_RESULTS_PATH=$(pwd)/results
DOCKER_RESULTS_PATH=/workspace/bionemo/results
LOCAL_DATA_PATH=$(pwd)/data
DOCKER_DATA_PATH=/workspace/bionemo/data
LOCAL_MODELS_PATH=$(pwd)/models
DOCKER_MODELS_PATH=/workspace/bionemo/models
JUPYTER_PORT=8888                                                        # Jupyter port for inference notebooks
REGISTRY=nvcr.io                                                         # Only required for registry login
REGISTRY_USER='$oauthtoken'                                              # Only required for registry login
NGC_CLI_API_KEY=$(grep -m 1 apikey ~/.ngc/config | head -n 1 | cut -d' ' -f3) # Requires NGC cli configuration
NGC_CLI_ORG=MyActualOrgName
NGC_CLI_TEAM=MyActualTeamName
NGC_CLI_FORMAT_TYPE=ascii

When I attempted to run it using $ sudo sh launch.sh pull, it displayed the following output: grep: /root/.ngc/config: No such file or directory.

Therefore, I edited this line from:

NGC_CLI_API_KEY=$(grep -m 1 apikey ~/.ngc/config | head -n 1 | cut -d' ' -f3)

to:

NGC_CLI_API_KEY=$(grep -m 1 apikey /home/ubuntu/.ngc/config | head -n 1 | cut -d' ' -f3)

Then, I ran $ sudo sh launch.sh pull again, but nothing showed in the terminal.

How can I fix this issue? What should be expected as terminal output if this script works correctly?

Hi KindnessCUDA,

From the error, it looks like the NGC_CLI_API_KEY variable is not set.
To resolve this, you can either do export NGC_CLI_API_KEY=<Your_NGC_API_Key>

Or run ngc config set before running launch.sh script from the terminal.

1 Like

Thank You for the Reply!

To ensure the NGC_CLI_API_KEY variable is set correctly, I ran the $ cat .ngc/config command, and the result was something like this:

;WARNING - This is a machine-generated file. Do not edit manually.
;WARNING - To update local config settings, see "ngc config set -h"

[CURRENT]
apikey = MyActualAPIKey
format_type = ascii
org = MyActualOrgName
org_display_name = MyActualOrgDisplayName
team = MyActualTeamName

However, to double-check and ensure accuracy, I created a new API Key and Team from the NVIDIA NGC control panel and ran ngc config set again to update the information. However, the result for the $ sudo sh launch.sh pull command was the same as described above.

Also, the same result occurred after running export NGC_CLI_API_KEY=<My_NGC_API_Key>.

$ sudo sh launch.sh pull
grep: /root/.ngc/config: No such file or directory

The bash launch.sh pull command executes docker pull nvcr.io/nvidia/clara/bionemo-framework:latest.

To run that command successfully, you will need to perform docker login nvcr.io

Instructions are provided here: Docker container access

After pulling an image, you can use the docker run command to create and start the BioNeMo Framework container based on that image.