-
Notifications
You must be signed in to change notification settings - Fork 19
Run xcache as user instead of root #84
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
Draft
holzman
wants to merge
1
commit into
opensciencegrid:master
Choose a base branch
from
holzman:remove-root
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,8 @@ | |
| ARG BASE_YUM_REPO=testing | ||
| ARG BASE_OSG_SERIES=3.5 | ||
|
|
||
| FROM opensciencegrid/software-base:$BASE_OSG_SERIES-el7-$BASE_YUM_REPO AS xcache | ||
| #FROM opensciencegrid/software-base:$BASE_OSG_SERIES-el7-$BASE_YUM_REPO AS xcache | ||
| FROM opensciencegrid/software-base:$BASE_OSG_SERIES-el7-bh AS xcache | ||
| LABEL maintainer OSG Software <help@opensciencegrid.org> | ||
|
|
||
| # Previous arg has gone out of scope | ||
|
|
@@ -22,8 +23,8 @@ ENV XC_NUM_LOGROTATE 10 | |
| ENV XC_FIX_DIR_OWNERS yes | ||
|
|
||
| # Create the xrootd user with a fixed GID/UID | ||
| RUN groupadd -o -g 10940 xrootd | ||
| RUN useradd -o -u 10940 -g 10940 -s /bin/sh xrootd | ||
| RUN groupadd -o -g 0 xrootd | ||
| RUN useradd -o -u 10940 -g 0 -s /bin/sh xrootd | ||
|
Comment on lines
+26
to
+27
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's this for? Does OKD not like groups?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By default, OKD runs containers with an ephemeral UID and GID 0. |
||
|
|
||
| # Create an empty macaroon-secret now so RPM installs won't create one, adding it to a layer. | ||
| RUN mkdir -p /etc/xrootd && touch /etc/xrootd/macaroon-secret | ||
|
|
@@ -40,9 +41,12 @@ RUN yum -y install /var/lib/xcache/*.rpm --enablerepo="osg-$BASE_YUM_REPO" || \ | |
|
|
||
| RUN yum install -y \ | ||
| xcache \ | ||
| sudo \ | ||
| gperftools-devel && \ | ||
| yum clean all --enablerepo=* && rm -rf /var/cache/yum/ | ||
|
|
||
| RUN echo "xrootd ALL=(ALL) NOPASSWD: /bin/chown -R xrootd\:xrootd *" >> /etc/sudoers.d/10-chown | ||
|
|
||
| ADD xcache/cron.d/* /etc/cron.d/ | ||
| RUN chmod 0644 /etc/cron.d/* | ||
| ADD xcache/sbin/* /usr/local/sbin/ | ||
|
|
@@ -58,6 +62,16 @@ RUN rm -f /etc/xrootd/macaroon-secret | |
| # in the XRootD logs | ||
| WORKDIR /var/spool/xrootd | ||
|
|
||
| # changes for OKD | ||
| RUN chgrp -R root /etc/xrootd && chmod -R g+w /etc/xrootd && \ | ||
| chgrp root /var/spool/xrootd && \ | ||
| chmod g+w /etc/environment /var/log /var/spool/xrootd /xcache && \ | ||
| chgrp root /etc/grid-security/xrd && chmod -R g+w /etc/grid-security/xrd /etc/grid-security/certificates && \ | ||
| chgrp -R root /run/xcache-auth /run/xrootd && chmod g+w /run/xcache-auth /run/xrootd && \ | ||
| chgrp -R root /var/log/xrootd && chmod g+w /var/log/xrootd && \ | ||
| chmod g+w /run && \ | ||
| chmod g+w /var/log/supervisor | ||
|
|
||
| ################ | ||
| # atlas-xcache # | ||
| ################ | ||
|
|
@@ -80,6 +94,8 @@ COPY atlas-xcache/10-atlas-xcache-limits.conf /etc/security/limits.d | |
| COPY atlas-xcache/supervisord.d/10-atlas-xcache.conf /etc/supervisord.d/ | ||
| COPY atlas-xcache/image-config.d/10-atlas-xcache.sh /etc/osg/image-init.d/ | ||
|
|
||
| USER xrootd | ||
|
|
||
| ############## | ||
| # cms-xcache # | ||
| ############## | ||
|
|
@@ -103,8 +119,12 @@ RUN chmod 0644 /etc/cron.d/* | |
| COPY cms-xcache/image-config.d/* /etc/osg/image-init.d/ | ||
| COPY cms-xcache/xcache-consistency-check-wrapper.sh /usr/bin/xcache-consistency-check-wrapper.sh | ||
|
|
||
| RUN chgrp root /var/lib/xcache-consistency-check && chmod g+w /var/lib/xcache-consistency-check | ||
|
|
||
| EXPOSE 1094 | ||
|
|
||
| USER xrootd | ||
|
|
||
| ############### | ||
| # stash-cache # | ||
| ############### | ||
|
|
@@ -116,7 +136,7 @@ ARG BASE_YUM_REPO=testing | |
|
|
||
| ENV XC_IMAGE_NAME stash-cache | ||
|
|
||
| RUN yum install -y stash-cache && \ | ||
| RUN yum install -y stash-cache hostname && \ | ||
| yum clean all --enablerepo=* && rm -rf /var/cache/ | ||
|
|
||
| COPY stash-cache/cron.d/* /etc/cron.d/ | ||
|
|
@@ -130,13 +150,14 @@ COPY stash-cache/Authfile /run/stash-cache/Authfile | |
| # Same for scitokens.conf | ||
| COPY stash-cache/scitokens.conf /run/stash-cache-auth/scitokens.conf | ||
|
|
||
| RUN touch /etc/xrootd-environment && chown xrootd:xrootd /etc/xrootd-environment | ||
| USER xrootd | ||
| EXPOSE 8000 | ||
|
|
||
| ################ | ||
| # stash-origin # | ||
| ################ | ||
|
|
||
|
|
||
| FROM xcache AS stash-origin | ||
| LABEL maintainer OSG Software <help@opensciencegrid.org> | ||
|
|
||
|
|
@@ -161,17 +182,19 @@ COPY stash-origin/xrootd/* /etc/xrootd/config.d/ | |
| # Add a placeholder scitokens.conf file, in case this origin isn't registered | ||
| # and can't pull down a new one | ||
| COPY stash-origin/scitokens.conf /run/stash-origin-auth/scitokens.conf | ||
| USER xrootd | ||
|
|
||
| ###################### | ||
| # atlas-xcache-debug # | ||
| ###################### | ||
|
|
||
| FROM atlas-xcache AS atlas-xcache-debug | ||
|
|
||
| # Install debugging tools | ||
| RUN yum -y install -y --enablerepo="$BASE_YUM_REPO" \ | ||
| gdb \ | ||
| strace | ||
|
|
||
| USER xrootd | ||
| #################### | ||
| # cms-xcache-debug # | ||
| #################### | ||
|
|
@@ -181,7 +204,7 @@ FROM cms-xcache AS cms-xcache-debug | |
| RUN yum -y install -y --enablerepo="$BASE_YUM_REPO" \ | ||
| gdb \ | ||
| strace | ||
|
|
||
| USER xrootd | ||
| ##################### | ||
| # stash-cache-debug # | ||
| ##################### | ||
|
|
@@ -191,6 +214,7 @@ FROM stash-cache AS stash-cache-debug | |
| RUN yum -y install -y --enablerepo="$BASE_YUM_REPO" \ | ||
| gdb \ | ||
| strace | ||
| USER xrootd | ||
|
|
||
| ##################### | ||
| # stash-cache-debug # | ||
|
|
@@ -201,3 +225,4 @@ FROM stash-origin AS stash-origin-debug | |
| RUN yum -y install -y --enablerepo="$BASE_YUM_REPO" \ | ||
| gdb \ | ||
| strace | ||
| USER xrootd | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| [program:atlas-xcache] | ||
| command=xrootd -c /etc/xrootd/xrootd-atlas-xcache.cfg -k fifo -n atlas-xcache -k %(ENV_XC_NUM_LOGROTATE)s -s /var/run/xrootd/xrootd-atlas-xcache.pid -l /var/log/xrootd/xrootd.log | ||
| user=xrootd | ||
| autorestart=true | ||
| environment=LD_PRELOAD=/usr/lib64/libtcmalloc.so,TCMALLOC_RELEASE_RATE=10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| #!/bin/bash | ||
| /usr/local/sbin/fix_certs.sh | ||
| su xrootd -c '/usr/libexec/xcache/renew-proxy --voms cms' | ||
| /usr/libexec/xcache/renew-proxy --voms cms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| [program:cms-xcache] | ||
| command=xrootd -c /etc/xrootd/xrootd-cms-xcache.cfg -k fifo -n cms-xcache -k %(ENV_XC_NUM_LOGROTATE)s -s /var/run/xrootd/xrootd-cms-xcache.pid -l /var/log/xrootd/xrootd.log | ||
| user=xrootd | ||
| autorestart=true | ||
| environment=LD_PRELOAD=/usr/lib64/libtcmalloc.so,TCMALLOC_RELEASE_RATE=10 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,13 @@ | ||
| [program:stash-cache-authfile-update] | ||
| command=/usr/libexec/xcache/authfile-update --cache | ||
| user=xrootd | ||
| priority=998 | ||
|
|
||
| [program:stash-cache] | ||
| command=xrootd -c /etc/xrootd/xrootd-stash-cache.cfg -k fifo -n stash-cache -k %(ENV_XC_NUM_LOGROTATE)s -s /var/run/xrootd/xrootd-stash-cache.pid -l /var/log/xrootd/xrootd.log | ||
| user=xrootd | ||
| autorestart=true | ||
| environment=LD_PRELOAD=/usr/lib64/libtcmalloc.so,TCMALLOC_RELEASE_RATE=10 | ||
|
|
||
| [program:stash-cache-auth] | ||
| command=xrootd -c /etc/xrootd/xrootd-stash-cache-auth.cfg -k fifo -n stash-cache-auth -k %(ENV_XC_NUM_LOGROTATE)s -s /var/run/xrootd/xrootd-stash-cache-auth.pid -l /var/log/xrootd/xrootd.log | ||
| user=xrootd | ||
| autorestart=true | ||
| environment=LD_PRELOAD=/usr/lib64/libtcmalloc.so,TCMALLOC_RELEASE_RATE=10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like a leftover from testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never mind, just saw your line about go-crond.