Skip to content

Windows Compatibility: ensuring Cwltool works on windows OS #419

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

Merged
merged 83 commits into from
Jul 17, 2017

Conversation

kapilkd13
Copy link
Contributor

@kapilkd13 kapilkd13 commented Jun 9, 2017

This is the main branch for windows compatible cwltool.

@kapilkd13
Copy link
Contributor Author

Hi, I am working on windows compatibility for cwltool. I am getting file not found error in TestFactory's test_partial_scatter and test_partial_output see here https://ci.appveyor.com/project/mr-c/cwltool/build/.7-master/job/usc0vga9xhaj7e39#L945 There are few requirements in cwl files of these tests like StepInputExpressionRequirement and ScatterFeatureRequirement see here and here.
I want to know if either of these testcases depends on symlinks or any unix dependent feature(except unix tools like echo,touch etc). Once I know this I can completely focus on debugging it. Thanks

appveyor.yml Outdated


test_script:
- "%CMD_IN_ENV% python setup.py test"
Copy link
Member

Choose a reason for hiding this comment

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

you can add a command before calling setup.py test to install requirements from pip.

Rather than modifying setup.py, replace schema_salad in requirements.txt to
https://github.com/kapilkd13/schema_salad/archive/windows#egg=schema_salad-2.4.20170612171942

Copy link
Member

Choose a reason for hiding this comment

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

this will be enough. you can remove dependency_link from setup.py if you use this approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently its just for testing, until schema-salad PR get merged. Its working fine right now but if any problem occur I will go this way. I liked the idea of tweaking requirements.txt rather than setup file.

Copy link
Member

@manu-chroma manu-chroma Jun 14, 2017

Choose a reason for hiding this comment

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

yeah, I feel the same. to just specify the version in setup.py 😄

@tetron
Copy link
Member

tetron commented Jun 14, 2017

StepInputExpressionRequirement and ScatterFeatureRequirement do not depend on symlinks or any unix features. They are internal operations on the workflow graph.

InplaceUpdate is an extension and doesn't need to be supported on Windows.

@kapilkd13
Copy link
Contributor Author

Thanks @tetron It helped 👍 Now we are passing all tests on appveyor. 😺

@kapilkd13
Copy link
Contributor Author

Hi @manu-chroma As you are working on python3 compatibiltiy, I think you can help me with this https://travis-ci.org/common-workflow-language/cwltool/jobs/243363735 travis failing test. It is saying too few args for lchmod but lchmod takes 2 args and are provided. Maybe I am missing something. Thanks

@manu-chroma
Copy link
Member

@kapilkd13 It's the python 3 builds which are failing. The Queue module has been renamed to queue in Python 3. this should help:

try:
    import queue #python3
except ImportError:
    import Queue as queue 

@manu-chroma
Copy link
Member

@kapilkd13, since you're using Queues with threads, I think it's better to use #419 (comment) rather than multiprocessing Queues.

You might find this useful: https://stackoverflow.com/a/925241/1180321

@kapilkd13
Copy link
Contributor Author

Okay. I would do that. Thanks for help help 😄

@kapilkd13
Copy link
Contributor Author

Thanks @manu-chroma 👍

@kapilkd13 kapilkd13 changed the title [WIP]Testing windows: not for merge Windows Compatibility: ensuring Cwltool works on windows OS Jul 17, 2017
@manu-chroma
Copy link
Member

@mr-c Would it make sense to do a release now that Python 3 is supported before merging this one?
If not on PyPI, a GitHub tag and release would make sense IMO. Thoughts?

cwltool/job.py Outdated
runtime.append(u"--user=%s" % (euid))

if rm_container:
runtime.append(u"--rm")

runtime.append(u"--env=TMPDIR=/tmp")
runtime.append(u"--env=TMPDIR=%s" % self.builder.tmpdir)
Copy link
Member

Choose a reason for hiding this comment

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

no, the tmpdir inside the docker container shouldn't change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay. I thought we hardcoded tmp by mistake. I will undo it.

cwltool/job.py Outdated
@@ -436,7 +450,7 @@ def _job_popen(

sp = subprocess.Popen(commands,
shell=False,
close_fds=True,
close_fds=False,
Copy link
Member

@mr-c mr-c Jul 17, 2017

Choose a reason for hiding this comment

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

That's a big change :-) How about close_fds=not onWindows(),?

@mr-c
Copy link
Member

mr-c commented Jul 17, 2017

Hey @kapilkd13

From the list below, what versions of Windows + docker have been tested?

Operating System :: Microsoft :: Windows :: Windows 10
Operating System :: Microsoft :: Windows :: Windows 3.1 or Earlier
Operating System :: Microsoft :: Windows :: Windows 7
Operating System :: Microsoft :: Windows :: Windows 8
Operating System :: Microsoft :: Windows :: Windows 8.1
Operating System :: Microsoft :: Windows :: Windows 95/98/2000
Operating System :: Microsoft :: Windows :: Windows CE
Operating System :: Microsoft :: Windows :: Windows NT/2000
Operating System :: Microsoft :: Windows :: Windows Server 2003
Operating System :: Microsoft :: Windows :: Windows Server 2008
Operating System :: Microsoft :: Windows :: Windows Vista
Operating System :: Microsoft :: Windows :: Windows XP

@kapilkd13
Copy link
Contributor Author

@mr-c Windows 10+native docker for windows and Windows 8.1+ docker toolbox have been tested. I won't be fully sure, but as it works with Docker Toolbox, I would say it should also support Win 8 and win 7.

@mr-c
Copy link
Member

mr-c commented Jul 17, 2017

@manu-chroma I'm making a separate release first, yep :-) See #472

@kapilkd13
Copy link
Contributor Author

@mr-c I think we are ready to go. That container issue is resolved. I removed additional code.

Copy link
Member

@mr-c mr-c left a comment

Choose a reason for hiding this comment

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

Otherwise this looks great!

tests/util.py Outdated
@@ -15,3 +17,8 @@ def get_data(filename):
if not filepath or not os.path.isfile(filepath):
filepath = os.path.join(os.path.dirname(__file__), os.pardir, filename)
return filepath

# Check if we are on windows OS
def onWindows():
Copy link
Member

Choose a reason for hiding this comment

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

why not use the version in utils.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean windows platform version for win 8 and 10. something like sys.platform==win32 etc?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh right 😄 I thought we put all test utilities in util file inside test folder. Earlier i was using this only. i will switch.

@mr-c mr-c merged commit 000b07c into common-workflow-language:master Jul 17, 2017
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.

4 participants