0

I am trying to use google cloud for machine learning course I follow the instructions in this page : https://github.com/google/eng-edu/blob/master/ml/cc/README.md

(In the section Running Datalab on Google Cloud)
I reached step 5 where I have to change the port to 8081
I follow the instructions and I get the following error :
Error: Could not connect to Cloud Shell on port 8081.
Ensure your server is listening on port 8081 and try again.
Can you tell me how to solve the problem ?
(I work in windows 10 and chrome)
Thanks,
Ilan

The following is the results of the datalab_create.sh which i activated by activating the command (instead of the shell) I activated 3 commands:

gcloud services enable compute_component
gcloud services enable ml.googleapis.com
./eng-edu/ml/cc/bin/datalab_connect.sh

Welcome to Cloud Shell! Type "help" to get started.
hindy_ilan@windy-hangar-200805:~$ gcloud services enable compute_component
Waiting for async operation operations/tmo-acf.a926e02c-e264-4ec1-b136-094a9efa6916 to complete...
Operation finished successfully. The following command can describe the Operation details:
 gcloud services operations describe operations/tmo-acf.a926e02c-e264-4ec1-b136-094a9efa6916
hindy_ilan@windy-hangar-200805:~$
hindy_ilan@windy-hangar-200805:~$ gcloud services operations describe operations/tmo-acf.a926e02c-e264-4ec1-b136-094a9efa6916
done: true
metadata:
  '@type': type.googleapis.com/google.api.servicemanagement.v1.OperationMetadata
  resourceNames:
  - services/compute_component/projectSettings/921211249673
name: operations/tmo-acf.a926e02c-e264-4ec1-b136-094a9efa6916
response:
  '@type': type.googleapis.com/google.api.servicemanagement.v1.EnableServiceResponse
hindy_ilan@windy-hangar-200805:~$ gcloud services enable ml.googleapis.com
Waiting for async operation operations/tmo-acf.e8aa5fe8-fbf5-4011-b730-461255f15805 to complete...
Operation finished successfully. The following command can describe the Operation details:
 gcloud services operations describe operations/tmo-acf.e8aa5fe8-fbf5-4011-b730-461255f15805
hindy_ilan@windy-hangar-200805:~$ gcloud services operations describe operations/tmo-acf.e8aa5fe8-fbf5-4011-b730-461255f15805
done: true
metadata:
  '@type': type.googleapis.com/google.api.servicemanagement.v1.OperationMetadata
  resourceNames:
  - services/ml.googleapis.com/projectSettings/921211249673
name: operations/tmo-acf.e8aa5fe8-fbf5-4011-b730-461255f15805
response:
  '@type': type.googleapis.com/google.api.servicemanagement.v1.EnableServiceResponse
hindy_ilan@windy-hangar-200805:~$ ./eng-edu/ml/cc/bin/datalab_connect.sh
Checking Datalab VM mlccvm-hindyilan exists
ERROR: Datalab VM does not exist
hindy_ilan@windy-hangar-200805:~$
user3315504
  • 1,055
  • 2
  • 12
  • 17
  • There is a [github issue](https://github.com/googledatalab/datalab/issues/1988) where the poster asks the exact same thing. There's some more context over there though, i.e. a log file which points to an error relating to the `gcloud service-management` command from the `datalab_create.sh`. Is that what you encountered as well? All in all, I think that you should discard the script, activate the APIs from your Console and run the `datalab create` and `datalab connect` commands yourself. – Lefteris S Apr 16 '18 at 07:13
  • The github issue is mind. I assume that google when publishing the scripts made no error and maybe there was something wrong in my running of it. I think the best way is to clean the project and try running it again – user3315504 Apr 16 '18 at 15:12

3 Answers3

0

This github issue (raised by the OP as indicated in this comment) includes a log file which points to the actual error (ERROR: (gcloud) Invalid choice: 'service-management'). The problem here is with the datalab_create.sh script and more specifically with the following two lines which enable the Google Compute Engine and Cloud Machine Learning APIs:

gcloud service-management enable compute_component
gcloud service-management enable ml.googleapis.com

The script is outdated: the service-management enable command has been replaced by services enable. When I tried to reproduce your issue I got a warning message indicating just that. My guess would be that you didn't get that message because you have been using a different Cloud SDK version than I do. Running with the latest version (197.0.0 as of April 17) throws these warnings but nevertheless enables the APIs. You can check which version you have enabled by running gcloud version and update to the latest by running gcloud components update.

The second option would be to replace those two lines with:

gcloud services enable compute_component
gcloud services enable ml.googleapis.com
Lefteris S
  • 1,614
  • 1
  • 7
  • 14
  • I run version 198.0.0 (It looks like google canceled the option for the old version of the command) anyway the second option worked. I have a new problem. Been desperate I used the delete command hopping to start all over again now I don't have VM. I got the following message `ERROR: Datalab VM does not exist` What is the way to get out of this situation? – user3315504 Apr 18 '18 at 09:27
  • I got this error for the `./eng-edu/ml/cc/bin/datalab_connect.sh` script (one step after the step you corrected successfully) – user3315504 Apr 18 '18 at 09:52
  • Can you share the full output from running `datalab_create.sh`? – Lefteris S Apr 20 '18 at 12:50
  • I added a log of activating the commands in datalab_create.sh to the question – user3315504 Apr 20 '18 at 16:18
0

The following is what i discovered:
The datalab_create.sh is:

hindy_ilan@windy-hangar-200805:~$ more ./eng-edu/ml/cc/bin/datalab_create.sh
#!/bin/bash
#
# A script to create a new Datalab VM.
#
# author: psimakov@google.com (Pavel Simakov)
set -e
. "$(dirname "$0")/common.sh"
prompt_user_for_confirmation "Google Compute Engine and Cloud Machine Learning APIs will be enabled and new Datalab VM will be created."
echo "Enabling Google Compute Engine and Cloud Machine Learning APIs"
gcloud service-management enable compute_component
gcloud service-management enable ml.googleapis.com
assert_datalab_vm_does_not_exist
ensure_components
echo "Provisioning a new Datalab VM"
datalab create "${MLCC_INSTANCE}" --zone="us-central1-a" --no-connect
echo "Success!"

The first 2 commands of the script were wrong so i replaced them (according to your advise with the commands :

gcloud services enable compute_component
gcloud services enable ml.googleapis.com

There is a third command in the script i tryed to activate and failed here are the results:

hindy_ilan@windy-hangar-200805:~$ datalab create "${MLCC_INSTANCE}" --zone="us-central1-a" --no-connect
Creating the network datalab-network
Creating the firewall rule datalab-network-allow-ssh
Creating the disk -pd
ERROR: (gcloud.compute.disks.create) unrecognized arguments: -pd
Usage: gcloud compute disks create DISK_NAME [DISK_NAME ...] [optional flags]
  optional flags may be  --csek-key-file | --description | --guest-os-features |
                         --help | --image | --image-family | --image-project |
                         --labels | --licenses | --require-csek-key-create |
                         --size | --source-snapshot | --type | --zone

Do you know how to operate this method?
Ilan

user3315504
  • 1,055
  • 2
  • 12
  • 17
0

Success! I corrected the datalab_create.sh(according to your recomendations) and run it
There is a need to enable the API and then run the script again
And after that it works OK Thanks, Ilan

user3315504
  • 1,055
  • 2
  • 12
  • 17