C4W2-Lab_2 Windows curl issue

Hi Ludwig! Welcome to Discourse!

Thank you for bringing this to our attention. The lab was tested on Windows 10 Home and didn’t encounter any issues with the installation. However, since you and Alexander have brought up issues with Virtualbox as the VM driver, we’ll modify the instructions to have more commands for Windows or to use WSL2 instead.

In your case, since you’ve already done some workarounds, you can try modifying the command to this:

curl.exe -d '{\"instances\": [1.0, 2.0, 5.0]}' -X POST "$(minikube ip):30001/v1/models/half_plus_two:predict"

The changes compared to the previous command are:

  • use curl.exe to avoid confusion with the Windows built-in curl that is an alias for Invoke-WebRequest (as mentioned by Alexander above). This also implies that you’ve added the curl path to your PATH as mentioned in the curl installation instructions.

  • the additional \ in the instances string is needed because Powershell parses the JSON string differently.

Now to run the script (request.sh) in a later section, there are also some revisions needed:

  1. Please run this command in Powershell to see if scripting is enabled:

Please remember the output value so you can set it back after the exercise. It is most likely Restricted.

  1. Enable scripting with:
Set-ExecutionPolicy RemoteSigned
  1. Then, please create a file called request.ps1 and paste this into it:
{curl.exe -d '{\"instances\": [1.0, 2.0, 5.0]}' -X POST "$(minikube ip):30001/v1/models/half_plus_two:predict"
} WHILE(1)

This mirrors the bash script in request.sh but is modified for Powershell.

  1. With that, you can run the script in Powershell with ./request.ps1

  2. When you’re done with the exercise, you can revert to the original ExecutionPolicy in step 1 in case you want to disable scripting.

On the other hand, if you also have Git for Windows installed in your computer, then you can also use its bundled Git Bash terminal instead of Powershell to run the lab. In my testing just now, you should be able to run all commands (including the request.sh) script as is without any modification in the repo aside from appending .exe to curl and kubectl (i.e. curl.exe and kubectl.exe). Just make sure that kubectl and curl are both in the Windows PATH.

We will modify the instructions to take note of these for Windows users. Thanks again and hope these help!