Skip to content

HelpersTask578_Docker_fails_due_to_missing_Docker_socket #583

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

Merged

Conversation

aangelo9
Copy link
Collaborator

Related to #578

Current Pipeline:

henv.env_to_str()
 └── henv.get_system_signature()
   └── hserver.get_docker_info()
     └── hserver.docker_needs_sudo()
       └── assert False # If Docker fails

We want to insert hserver.is_external_dev().
Approach:

Insert in hserver.get_docker_info():

def get_docker_info() -> str:
    ...
    if is_external_dev():
        docker_needs_sudo_ = None
    else:
        docker_needs_sudo_ = docker_needs_sudo()
    ...

Insert in henv.get_system_signature():

def get_system_signature(git_commit_type: str = "all") -> Tuple[str, int]:
    ...
    # Add Docker info conditionally
    if hserver.is_external_dev():
        txt_tmp = "External dev: skipping Docker check"
    else:
        txt_tmp = hserver.get_docker_info()
    ...

Implementation in hserver.get_docker_info() might be better for future use cases if its reused elsewhere. It also encapsulates safety logic in one place since it already calls is_inside_docker_.

@aangelo9 aangelo9 self-assigned this Apr 16, 2025
@aangelo9 aangelo9 requested a review from sonniki April 16, 2025 21:34
@sonniki
Copy link
Contributor

sonniki commented Apr 17, 2025

Insert in hserver.get_docker_info():

def get_docker_info() -> str:
    ...
    if is_external_dev():
        docker_needs_sudo_ = None
    else:
        docker_needs_sudo_ = docker_needs_sudo()
    ...

IMO this approach is better (with a comment added for clarity after if is_external_dev():, and with False instead of None to keep the type consistent).

Actually, maybe this can even be added as an extra condition in docker_needs_sudo() itself... @gpsaggese @samarth9008 @heanhsok WDYT?

@aangelo9 aangelo9 marked this pull request as ready for review April 22, 2025 16:52
@heanhsok
Copy link
Contributor

heanhsok commented Apr 29, 2025

@aangelo9 could you help add the fix mentioned here #578 (comment) as well ?

The file to change is
https://github.com/causify-ai/helpers/blob/master/devops/docker_build/etc_sudoers#L32

@aangelo9 aangelo9 requested a review from heanhsok April 29, 2025 22:09
@heanhsok
Copy link
Contributor

LGTM.

Thanks for the help with debugging @aangelo9

If all looks good, I can build and release a new version of //helpers image. WDYT? @gpsaggese @sonniki

@heanhsok heanhsok requested a review from gpsaggese April 30, 2025 15:52
@aangelo9 aangelo9 requested a review from heanhsok April 30, 2025 16:05
@aangelo9 aangelo9 requested a review from heanhsok April 30, 2025 16:30
@heanhsok
Copy link
Contributor

heanhsok commented Apr 30, 2025

LGTM

@heanhsok
Copy link
Contributor

heanhsok commented May 6, 2025

@gpsaggese gpsaggese merged commit 5d3bbbd into master May 8, 2025
4 checks passed
@gpsaggese gpsaggese deleted the HelpersTask578_Docker_fails_due_to_missing_Docker_socket branch May 8, 2025 20:24
@heanhsok heanhsok mentioned this pull request May 9, 2025
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants