@@ -16,40 +16,43 @@ chatbot does two things:
16
16
17
17
## Setup
18
18
19
+ Download the [ Google Cloud SDK] ( https://cloud.google.com/sdk/ ) to your local machine.
20
+ It will allow you to access many of the features of Google Compute Engine via
21
+ your local machine.
22
+
23
+ Clone this project to your local machine.
24
+
19
25
Follow the instructions at the
20
26
[ Compute Engine Quickstart Guide] ( https://cloud.google.com/compute/docs/quickstart-linux )
21
27
on how to create a project, create a virtual machine, and connect to your
22
- instance via SSH. Once you have done this, you may jump to
23
- [ Installing files and dependencies] ( #installing-files-and-dependencies ) .
28
+ instance via SSH.
24
29
25
- You should also download the [ Google Cloud SDK] ( https://cloud.google.com/sdk/ ) .
26
- It will allow you to access many of the features of Google Compute Engine via
27
- your local machine.
30
+ Copy the ` wikibot.py ` and ` requirements.txt ` files from this sample to your remote
31
+ instance running in Compute Engine using the following commands from your local machine:
28
32
29
- ** IMPORTANT** You must enable tcp traffic on port 5000 to send messages to the
30
- XMPP server. This can be done by running the following SDK commands:
33
+ gcloud config set compute/zone ZONE
31
34
32
- gcloud config set project <YOUR PROJECT NAME >
35
+ gcloud config set compute/region REGION
36
+
37
+ gcloud compute copy-files [LOCAL_FILE_PATH] [INSTANCE_NAME]:~/
33
38
34
- gcloud compute firewall-rules create wikibot-server-rule --allow tcp:5000 --source-ranges=0.0.0.0/0
39
+ Replace ZONE, REGION, and [ INSTANCE_NAME] with the values from your project. Replace
40
+ [ LOCAL_FILE_PATH] with the path to the ` wikibot.py ` and ` requirement.txt ` files.
35
41
36
- Or you can create a new firewall rule via the UI in the
37
- [ Networks] ( https://console.cloud.google.com/networking/networks/list ) section of
38
- the Google Cloud Console.
42
+ Using the SSH terminal into the project instance, install the dependencies using [ pip] ( http://pip.readthedocs.io/en/stable/ ) :
39
43
40
- ### Installing files and dependencies
44
+ pip install -r requirements.txt
41
45
42
- First, install the ` wikibot.py ` and ` requirements.txt ` files onto your remote
43
- instance. See the guide on
44
- [ Transferring Files] ( https://cloud.google.com/compute/docs/instances/transfer-files )
45
- for more information on how to do this using the Mac file browser, ` scp ` , or
46
- the Google Cloud SDK.
47
46
48
- Before running or deploying this application, you must install the dependencies
49
- using [ pip] ( http://pip.readthedocs.io/en/stable/ ) :
47
+ Enable tcp traffic on port 5000 to send messages to the XMPP server, by running the following SDK commands:
48
+
49
+ gcloud config set project <YOUR PROJECT NAME >
50
50
51
- pip install -r requirements.txt
51
+ gcloud compute firewall-rules create wikibot-server-rule --allow tcp:5000 --source-ranges=0.0.0.0/0
52
52
53
+ Alternatively to enabling ` tcp ` traffic on port 5000, you can create a new firewall rule via the UI in the
54
+ [ Networks] ( https://console.cloud.google.com/networking/networks/list ) section of
55
+ the Google Cloud Console.
53
56
54
57
## Running the sample
55
58
@@ -69,4 +72,4 @@ Enter control-Z to stop the server
69
72
### Running on your local machine
70
73
71
74
You may also run the sample locally by simply copying ` wikibot.py ` to a project
72
- directory and installing all python dependencies there.
75
+ directory and installing all python dependencies there.
0 commit comments