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

feat: add bindfs to support linux users. Fixes #594 #769

Merged
merged 3 commits into from
Feb 3, 2022

Conversation

drmikecrowe
Copy link

@drmikecrowe drmikecrowe commented Feb 2, 2022

what && why

notes

This PR only partly addressed #594. Work continued in #771, after which we considered #594 closed.

Copy link
Contributor

@Nuru Nuru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drmikecrowe Thank you for this PR.

There are a bunch of nitpicky things I want to change, and I will make the changes, I just need you to confirm that this approach does everything you need with respect to file ownership and permissions and allowing you to continue to run as root inside Geodesic.

@drmikecrowe
Copy link
Author

Confirmed -- I'm using this in my build w/o an issue.

I'm happy to adapt for future PR's if you'll share the nit-picky stuff :)

@Nuru
Copy link
Contributor

Nuru commented Feb 3, 2022

@drmikecrowe @nitrocode @korenyoni @sboardwell Please try this version and verify it fixes the listed bugs to the extent you those bugs were bothering you, and report back here, even though this PR has been closed. Docker images are cloudposse/geodesic:0.151.0-rc1-debian and cloudposse/geodesic:0.151.0-rc1-alpine .

@Nuru Nuru changed the base branch from master to bindfs February 3, 2022 09:07
@Nuru Nuru merged commit 90fa1b9 into cloudposse:bindfs Feb 3, 2022
@Nuru
Copy link
Contributor

Nuru commented Feb 3, 2022

PR closed and released as v0.151.0-rc1. Please try it out and report back here.

@Nuru Nuru added bugfix Change that restores intended behavior enhancement New feature or request labels Feb 3, 2022
@Nuru
Copy link
Contributor

Nuru commented Feb 3, 2022

Release candidate v0.152.0-rc1 published, includes this PR and updates to Alpine and Debian versions.

@sboardwell
Copy link

@Nuru I have a MacBook now, sorry.

@drmikecrowe
Copy link
Author

Startup shows:

# Mounting /home/mcrowe into container at localhost.bindfs
# Starting new infrastructure session from pinnsg/infrastructure:latest
# Exposing port 33045
# Launching with extra Docker args: --volume=/home/mcrowe/Programming/Pinnacle/infrastructure:/project --volume=/home/mcrowe/Programming/Pinnacle/infrastructure/../websites:/websites --volume=/home/mcrowe/.encrypted:/conf/.encrypted
########################################################################################            
# No filesystem is mounted at /localhost which l

Additionally, added set -x to the top and ran:

set -x
if [[ $SHLVL == 1 ]] && [[ -n $GEODESIC_HOST_UID ]] && [[ -n $GEODESIC_HOST_GID ]] \
        && [[ -n $GEODESIC_LOCALHOST ]] && df -a | grep -q " ${GEODESIC_LOCALHOST}\$"; then

output:

 ⧉  Pinnacle 
 ✗ . [none] ~ ⨠ /etc/profile.d/_20-localhost.sh 
++ [[ 2 == 1 ]]
 ⧉  Pinnacle 

Dockerfile:

ARG VERSION=0.151.0-rc1
ARG OS=debian
ARG CLI_NAME=infrastructure

FROM cloudposse/geodesic:$VERSION-$OS

###
### NVM for Node
####################################################################
SHELL ["/bin/bash", "--login", "-i", "-c"]
ENV NVM_DIR="/usr/local/nvm"
RUN ( git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" && \
        cd "$NVM_DIR" && \
        git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` )
RUN source "$NVM_DIR/nvm.sh" && nvm install 14 && npm i -g npm npm-check-updates && npm i -g yarn
####################################################################

# Geodesic banner
ENV BANNER="Pinnacle"
RUN chmod 755 /etc/profile.d/*
COPY rootfs/ /
RUN rm -rf /localhost
WORKDIR /
❯ find rootfs/
rootfs/
rootfs/etc
rootfs/etc/profile.d
rootfs/etc/profile.d/project.sh
rootfs/etc/profile.d/nvm.sh

(project.sh is global aliases for everybody, etc)

@Nuru
Copy link
Contributor

Nuru commented Feb 14, 2022

@drmikecrowe

The files under /etc/profile.d/ need to be source'd to be effective. The [[ 2 == 1 ]] prevents the script from running in a subshell.

The problem you are having is likely due to you not running the new version of the wrapper script. So far I cannot find any source for the exact message

Mounting /home/mcrowe into container at localhost.bindfs

Prior to release 0.149.0 the wrapper message was simply

# Mounting ${local_home} into container

With 0.149.0 the message changed to

# Mounting ${local_home} into container with workdir ${GEODESIC_HOST_CWD}

It looks to me like you are running your own customized version of the older wrapper. Please save a copy of your custom wrapper, update your wrapper with make install, and try again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Change that restores intended behavior enhancement New feature or request
Projects
None yet
3 participants