helpers icon indicating copy to clipboard operation
helpers copied to clipboard

Error when running docker_bash

Open gpsaggese opened this issue 7 months ago • 2 comments

In helpers

> i docker_bash

I see a

# set_path()
ERROR: Directory '' does not exist.
ERROR: Directory '/import_check' does not exist.

in the log

# docker_pull: stage='dev', version=None, skip_pull=False                                                                                                                                                                                                                 13:45:58 [111/3163]
# docker_login: target_registry='aws_ecr.ck'
17:45:56 - WARN  lib_tasks_docker.py docker_login:405                   Skipping Docker login process for Helpers or Tutorials
17:45:56 - INFO  lib_tasks_docker.py _docker_pull:230                   image='causify/helpers:dev'
docker pull causify/helpers:dev
dev: Pulling from causify/helpers
Digest: sha256:43ac049013f992d7efc4a8196bfa15dc0b3f7559e52848adf825c3c7b5c84ca3
Status: Image is up to date for causify/helpers:dev
docker.io/causify/helpers:dev

What's next:
    View a summary of image vulnerabilities and recommendations → docker scout quickview causify/helpers:dev
IMAGE=causify/helpers:dev \
        docker compose \
        --file /Users/saggese/src/helpers1/devops/compose/tmp.docker-compose.yml \
        --env-file devops/env/default.env \
        run \
        --rm \
        --name saggese.helpers.app.helpers1.20250515_134556 \
        --user $(id -u):$(id -g) \
        app \
        bash
WARN[0000] The "CSFY_FORCE_TEST_FAIL" variable is not set. Defaulting to a blank string.
WARN[0000] The "CSFY_AWS_ACCESS_KEY_ID" variable is not set. Defaulting to a blank string.
WARN[0000] The "CSFY_AWS_DEFAULT_REGION" variable is not set. Defaulting to a blank string.
WARN[0000] The "CSFY_AWS_SECRET_ACCESS_KEY" variable is not set. Defaulting to a blank string.
WARN[0000] The "CSFY_AWS_SESSION_TOKEN" variable is not set. Defaulting to a blank string.
WARN[0000] The "CSFY_TELEGRAM_TOKEN" variable is not set. Defaulting to a blank string.
WARN[0000] /Users/saggese/src/helpers1/devops/compose/tmp.docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
##> devops/docker_run/entrypoint.sh
UID=501
GID=20
CSFY_USE_HELPERS_AS_NESTED_MODULE=1
CSFY_HOST_GIT_ROOT_PATH=/Users/saggese/src/helpers1
CSFY_GIT_ROOT_PATH=/app
CSFY_HELPERS_ROOT_PATH=/app
> source /app/dev_scripts_helpers/thin_client/thin_client_utils.sh ...
AM_CONTAINER_VERSION='1.2.0'
CSFY_USE_HELPERS_AS_NESTED_MODULE=1
##> devops/docker_run/docker_setenv.sh
> source /app/dev_scripts_helpers/thin_client/thin_client_utils.sh ...
# activate_docker_venv()
# set_path()
ERROR: Directory '' does not exist.
ERROR: Directory '/import_check' does not exist.
PATH=.:./config_root:./devops:./import_check:./.pytest_cache:./papers:./__pycache__:./docs:./.mypy_cache:./.github:./linters:./.git:./.vscode:./helpers:./dev_scripts_helpers:/import_check::/app:/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# set_up_docker_git()
git --version: git version 2.43.0
/app
...

There are several issues:

  1. Do we need to pass GIT_ROOT through the container? We can do that, since I've extended the code to do that
  2. How come the assertion doesn't stop the execution?

gpsaggese avatar May 15 '25 17:05 gpsaggese

  1. Do we need to pass GIT_ROOT through the container? We can do that, since I've extended the code to do that

We use this variable to match the convention where the env vars in containers start with CSFY

CSFY_HOST_GIT_ROOT_PATH=/Users/saggese/src/helpers1
  1. How come the assertion doesn't stop the execution?

I think maybe it’s because we're using kill -INT $$ to stop the script. From what I have read, if the parent shell traps or ignores SIGINT, that signal won’t terminate the script. Using exit 1 or return 1 might be more reliable?

https://github.com/causify-ai/helpers/blob/4868c54a4abf5a45ebef98dc7574422408e6bcf9/dev_scripts_helpers/thin_client/thin_client_utils.sh#L56-L63

heanhsok avatar May 15 '25 19:05 heanhsok

set_path() ERROR: Directory '' does not exist.

I think the client code is missing the ., which points to the current dir

https://github.com/causify-ai/helpers/blob/4868c54a4abf5a45ebef98dc7574422408e6bcf9/devops/docker_run/docker_setenv.sh#L37-L38

heanhsok avatar May 15 '25 20:05 heanhsok

Closing as the problem no longer appears to occur. Follow-ups can be filed if needed.

heanhsok avatar Jul 08 '25 20:07 heanhsok