Skip to content

Hail parallelized diff expression - #20

Open
jamestwebber wants to merge 4 commits into
mainfrom
HailParallelized
Open

Hail parallelized diff expression#20
jamestwebber wants to merge 4 commits into
mainfrom
HailParallelized

Conversation

@jamestwebber

Copy link
Copy Markdown
Contributor

Opening a PR just to keep track of any comments / changes.

This is @JZL's implementation of differential expression via Hail, with the hope that we can massively scale up the computation to remove one of the main blockers in the clustering strategy.

Comment on lines +27 to +30
USER root

RUN adduser $MAMBA_USER sudo \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

does this just get run as root? is there a need to have $MAMBA_USER at all?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the mamba docs very strongly want to use $MAMBA_USER, especially for the conda package installation.

But then there's weirdness where hail batch assumes you run as root, and their internal setup code fails if you don't (I could post an issue with them 🤷 ). So not elegant. You can use anaconda and side step all of this it's just a good amount slower to create the initial docker image (not load in I mean) and I preferred mamba.

The sudo line might not be necessary with the current config, just the USER root line. As a tangent, I was having trouble with hail batch keeping jobs open even after the python finished, because the dask forks/children weren't closing. So I needed mamba to have sudo to do increasingly aggressive kill lines. But then sys.exit worked when I did that

@JZL JZL Jul 28, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh ok or maybe I just hallucinated.
https://github.com/mamba-org/micromamba-docker

Running with --user=root is supported.

I somehow read that as "is not supported". So maybe it call all be run as root, either way

If rebuilding this image from scratch, the default username mambauser can be adjusted by passing --build-arg MAMBA_USER=new-username to the docker build command. User id and group id can be adjusted similarly by passing --build-arg MAMBA_USER_ID=new-id --build-arg MAMBA_USER_GID=new-gid

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

since there's always a USER root command on line 17 and the MAMBA_USER isn't used, I think these lines can just be removed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sure ok, do you want me to push a commit removing them?

Just for ease of context switching ease, I can collect the more cosmetic changes and make a bigger commit later, if that works, as long as the bones of the parallelization end up working on your end

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can do it, was just double-checking that it wasn't doing something important.

Comment on lines +1 to +14
cd /dev/shm

while true; do
if compgen -G "/dev/shm/rtmp*" > /dev/null; then
echo "Some files exist."
break
fi
sleep 30
done

TOTAL=$(ls|grep rtmp|head -n 1|sed -E "s/(^[^_]*_)|(__.*)//g")
echo $TOTAL
# Assume divide by 10
while true; do ls rtmp*|wc -l; sleep 10; done|tqdm --ncols=100 --update_to --total=$TOTAL --smoothing=0.3 --initial=`ls rtmp* |wc -l`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What does this script do? It doesn't look like it's getting used, but maybe you use it interactively?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh sorry, I meant to remove it, it just makes a nice cli progress bar (I used it for the mapping hail). Could be marginally nice if you end up running multiple diffexps per hail batch, just to track the progress, but unecessary

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess I just removed it from the Dockerfile, it was called with a background ampersand same as getcpu.sh

import dask.distributed

# Maybe faster, equivalent API
import _pickle as cPickle

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

FYI in python 3 the regular pickle module uses the C implementation already. This difference was relevant in python 2

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.

3 participants