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

avoid dependency on bzip2 #1570

Merged
merged 4 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions metaflow/plugins/pypi/bootstrap.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import bz2
import io
import json
import os
import shutil
import subprocess
import sys
import tarfile

from metaflow.metaflow_config import DATASTORE_LOCAL_DIR
from metaflow.plugins import DATASTORES
from metaflow.util import which

from . import MAGIC_FILE, _datastore_packageroot

Expand Down Expand Up @@ -79,9 +83,9 @@
# Create Conda environment.
cmds = [
# TODO: check if mamba or conda are already available on the image
# TODO: search for micromamba everywhere
f"""if ! command -v ./micromamba >/dev/null 2>&1; then
wget -qO- https://micro.mamba.pm/api/micromamba/{architecture}/latest | tar -xvj bin/micromamba --strip-components=1 >/dev/null 2>&1;
export PATH=$PATH:$HOME/bin;
wget -qO- https://micro.mamba.pm/api/micromamba/{architecture}/latest | python -c "import sys, bz2; sys.stdout.buffer.write(bz2.decompress(sys.stdin.buffer.read()))" | tar -xv bin/micromamba --strip-components=1 ;
if ! command -v ./micromamba >/dev/null 2>&1; then
echo "Failed to install Micromamba!";
exit 1;
Expand Down
2 changes: 1 addition & 1 deletion metaflow/plugins/pypi/conda_environment.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import errno
import fcntl
import functools
import time
import io
import json
import os
import sys
import time
from concurrent.futures import ThreadPoolExecutor
from hashlib import sha256
from io import BufferedIOBase
Expand Down
Loading