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

CLI fails to deploy when building python wheels on Windows with WSL installed #1159

Closed
NathanNZ opened this issue Jan 28, 2024 · 1 comment · Fixed by #1169
Closed

CLI fails to deploy when building python wheels on Windows with WSL installed #1159

NathanNZ opened this issue Jan 28, 2024 · 1 comment · Fixed by #1169
Assignees
Labels
Bug Something isn't working DABs DABs related issues

Comments

@NathanNZ
Copy link

NathanNZ commented Jan 28, 2024

Describe the issue

When using a Wheel task eg:

  python_wheel_task:
            package_name: default_python
            entry_point: main
          libraries:
            - whl: ../dist/*.whl

Validation completes, but deployment fails with:

Error: build failed default, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec3488002273.sh: No such file or directory

Configuration

Please provide a minimal reproducible configuration for the issue

Steps to reproduce the behavior

  1. Install Windows with WSL enabled (https://learn.microsoft.com/en-us/windows/wsl/install)
  2. Download the zip file from GitHub and add to path
  3. Grab the default_python folder (https://github.com/databricks/bundle-examples)
  4. Change directory into the default_python folder, fix up the target destinations and run databricks bundle deploy
  5. See the error Error: build failed default, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory

Expected Behavior

The wheel builds and deployment completes successfully.

Actual Behavior

The wheel fails to build and deployment completes successfully.

OS and CLI version

  • Databricks CLI v0.212.2 (From GitHub releases)
  • Windows 11 23H2 (10.0.22631.3085)
  • Python 3.12.1

Is this a regression?

Yes - this was working with v0.211.0

Logs

Having a look at code that looks a bit suspicious:

out, err := osexec.LookPath("bash")

It looks like it checks if the path "bash" exists, that unfortunately isn't enough to detect if bash for Windows is installed as WSL (Windows Subsystem for Linux) will route all commands sent to bash to the Linux subsystem, but that's not what we want in this case!

I believe the best solution is to just use CMD on Windows - that way if developers have WSL installed it won't cause issues.

Building default_python...
18:10:56 ERROR Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
 pid=37912 mutator=seq mutator=build mutator=seq mutator=artifacts.BuildAll mutator=seq mutator=artifacts.Build(default_python) mutator=artifacts.whl.Build(default_python)
18:10:56 ERROR Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
 pid=37912 mutator=seq mutator=build mutator=seq mutator=artifacts.BuildAll mutator=seq mutator=artifacts.Build(default_python)
18:10:56 ERROR Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
 pid=37912 mutator=seq mutator=build mutator=seq mutator=artifacts.BuildAll mutator=seq
18:10:56 ERROR Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
 pid=37912 mutator=seq mutator=build mutator=seq mutator=artifacts.BuildAll
18:10:56 ERROR Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
 pid=37912 mutator=seq mutator=build mutator=seq
18:10:56 ERROR Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
 pid=37912 mutator=seq mutator=build
18:10:56 ERROR Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
 pid=37912 mutator=seq
Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
@NathanNZ NathanNZ added the DABs DABs related issues label Jan 28, 2024
@NathanNZ NathanNZ changed the title Databricks fails to deploy bundles that depend on wheels under Windows Databricks fails to deploy bundles with Wheels when WSL is enabled Jan 28, 2024
@NathanNZ NathanNZ changed the title Databricks fails to deploy bundles with Wheels when WSL is enabled CLI fails to deploy when building python wheels bundles on Windows with WSL installed Jan 28, 2024
@NathanNZ NathanNZ changed the title CLI fails to deploy when building python wheels bundles on Windows with WSL installed CLI fails to deploy when building python wheels on Windows with WSL installed Jan 28, 2024
@andrewnester andrewnester self-assigned this Jan 29, 2024
@andrewnester andrewnester added the Bug Something isn't working label Jan 29, 2024
github-merge-queue bot pushed a commit that referenced this issue Feb 1, 2024
#1169)

## Changes
Allow specifying executable in artifact section

```
artifacts:
  test:
    type: whl
    executable: bash
    ...
```

We also skip bash found on Windows if it's from WSL because it won't be
correctly executed, see the issue above

Fixes #1159
@andrewnester
Copy link
Contributor

The fix has been merged and will be released in the next CLI release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working DABs DABs related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants