Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vsoch
Copy link
Owner

@vsoch vsoch commented Oct 14, 2019

And fixing bug that we should not run a command if the executable is not found. This pull request can be tested either locally or with a container.

Locally

First remove all installations of scif:

pip uninstall scif

do that command until it tells you it isn't installed. Then clone the branch here:

$ git clone -b test/stream-capture-output https://www.github.com/vsoch/scif
cd scif
python setup.py install

And test as you need!

Container Test

if you want to test with a container, I've pushed the tag 0.0.78-rc to quay.io

docker pull quay.io/scif/scif:0.0.78rc

And you can use this container as a base for your own scif recipe, or any of the tutorials or examples.
Signed-off-by: Vanessa Sochat [email protected]

@dkp
Copy link

dkp commented Oct 14, 2019

Whoa, you are amazing!
My initial recipes are here (in case it would be useful to take a look): https://bitbucket.org/dpat/scif_fsl/src/master/

So, I tried your branch by adding this to my Dockerfile instead of "RUN pip install scif":

RUN git clone -b test/stream-capture-output https://www.github.com/vsoch/scif
RUN cd scif && python setup.py install

It seemed to do the install, but then freaked out on my scif recipes (which were behaving last night). I'll upload the whole log, but things aren't interesting, I think, until about line 485.
scif_experiment_log.txt

@vsoch
Copy link
Owner Author

vsoch commented Oct 14, 2019

You need to use Python 3.x version - at this point (since Python 2 end of life is ~2 months) you shouldn't be developing with Python 2, really ever.

@vsoch
Copy link
Owner Author

vsoch commented Oct 14, 2019

I can try using from __future__ import print_function, but I'll still strongly suggest you not use Python 2 :)

@vsoch
Copy link
Owner Author

vsoch commented Oct 14, 2019

Here is how it works:

Here is your error

$ python2
Python 2.7.15+ (default, Oct  7 2019, 17:39:04) 
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print("test", end="")
  File "<stdin>", line 1
    print("test", end="")
                     ^
SyntaxError: invalid syntax

Here is the workaround

>>> from __future__ import print_function
>>> print("test", end="\n")
test

Give me a few minutes to update the PR.

@vsoch
Copy link
Owner Author

vsoch commented Oct 14, 2019

-> 19b6605

@dkp
Copy link

dkp commented Oct 14, 2019

Gosh, this is news to me. I install Python3 in the Dockerfile...I guess, since it is based on Ubuntu Trusty, it must be using Python2 by default, even though I installed Python 3? Thanks for identifying that issue. I'll try to make improvements on my end.

@vsoch
Copy link
Owner Author

vsoch commented Oct 14, 2019

Yes that's exactly true - the "python" executable maps to python 2, and python3 to python 3. Here is a quick example:

$ docker run -it ubuntu:trusty
# Not installed
root@25b7d9b5261e:/# which python
root@25b7d9b5261e:/# apt-get update && apt-get install -y python3 python3-dev
...
# still not installed
root@25b7d9b5261e:/# which python

# installed
root@25b7d9b5261e:/# which python3
/usr/bin/python3

I think when you install python-pip it probably installs python2 as a dependency. You want to do python3-pip instead, if I remember correctly.

@dkp
Copy link

dkp commented Oct 14, 2019

I'm with you:
apt-get python3-pip
RUN pip3 install scif

Now I'll try with your streaming version.

@dkp
Copy link

dkp commented Oct 14, 2019

Okay, your streaming version builds now...AND, it is streaming output right to my screen as it runs!!
So cool, thank you!

-Dianne

@vsoch
Copy link
Owner Author

vsoch commented Oct 14, 2019

Awesome! I'm going to merge now (so you could install from master branch) but will wait to release on pypi as 0.0.78 until the conda recipe is merged conda-forge/staged-recipes#9853 that way the release will trigger a conda build.

@vsoch vsoch merged commit 05e3fc0 into master Oct 14, 2019
@vsoch vsoch deleted the test/stream-capture-output branch October 14, 2019 18:30
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