|
32 | 32 | "source": [
|
33 | 33 | "## Start CipherStash Proxy and PostgreSQL\n",
|
34 | 34 | "\n",
|
35 |
| - "To start CipherStash Proxy and PostgreSQL on your machine, use the included `docker-compose.yml`.\n", |
36 |
| - "This file requires you to set up a few environment variables:\n", |
37 |
| - "\n", |
38 |
| - "* `CS_WORKSPACE_ID`\n", |
39 |
| - "* `CS_DATASET_ID`\n", |
40 |
| - "* `CS_CLIENT_ACCESS_KEY`\n", |
41 |
| - "* `CS_ENCRYPTION__CLIENT_ID`\n", |
42 |
| - "* `CS_ENCRYPTION__CLIENT_KEY`\n", |
43 |
| - "\n", |
44 |
| - "There are other variables but default values are set for them in `docker-compose.yml`.\n", |
45 |
| - "Change them if necessary to suit your setup.\n", |
46 |
| - "\n", |
47 |
| - "If have the values for these variables available, you can skip to the **\"Upload dataset config\"** section.\n", |
48 |
| - "Otherwise, sign up to [CipherStash](https://cipherstash.com/signup), install [CipherStash CLI](https://github.com/cipherstash/cli-releases/releases/latest), and do the following steps:" |
49 |
| - ] |
50 |
| - }, |
51 |
| - { |
52 |
| - "cell_type": "markdown", |
53 |
| - "id": "0d2fd39b-86a2-4e34-a214-7c9bf13f9579", |
54 |
| - "metadata": { |
55 |
| - "jp-MarkdownHeadingCollapsed": true |
56 |
| - }, |
57 |
| - "source": [ |
58 |
| - "### Log into the workspace\n", |
59 |
| - "\n", |
60 |
| - "Make sure that you have `stash` command available in your PATH, and run the command below in your terminal (not here in this notebook) and follow the instructions.\n", |
61 |
| - "You will be either automatically be logged into your workspace, or be prompted to log into one of them.\n", |
62 |
| - "Note the **Workspace ID** shown here.\n", |
63 |
| - "\n", |
64 |
| - "> `stash login`" |
65 |
| - ] |
66 |
| - }, |
67 |
| - { |
68 |
| - "cell_type": "markdown", |
69 |
| - "id": "3e82b124-9fa2-4ec7-a9a2-f46a3d439a6c", |
70 |
| - "metadata": {}, |
71 |
| - "source": [ |
72 |
| - "### Create an access key\n", |
73 |
| - "\n", |
74 |
| - "> **NOTE**: If you already have an access key and prefer to use that rather than create a new one, you can use it instead. However, it is recommended that you create one here to use with this notebook.\n", |
75 |
| - "\n", |
76 |
| - "Now you need to create an access key for the workspace.\n", |
77 |
| - "Run the following command and **securely store** the value for **CS_CLIENT_ACCESS_KEY** as you will not be able to recover it if you lose it.\n", |
78 |
| - "The `CS_WORKSPACE_ID` should be the same value as the Workspace ID shown at the step above.\n", |
79 |
| - "\n", |
80 |
| - "> **NOTE**: If you receive an error like **\"Unable to create access key: Request failed: Duplicate key error: ...\"**, unless you have used this key anywhere else, you can revoke the key from your terminal like:\n", |
81 |
| - "> \n", |
82 |
| - "> `stash access-keys revoke cipherstash_getting_started_access_key`\n", |
83 |
| - "> \n", |
84 |
| - "> and run the 'access-keys create' command again" |
85 |
| - ] |
86 |
| - }, |
87 |
| - { |
88 |
| - "cell_type": "code", |
89 |
| - "execution_count": null, |
90 |
| - "id": "1e616ebe-dad6-430c-bfa4-8792390bb939", |
91 |
| - "metadata": {}, |
92 |
| - "outputs": [], |
93 |
| - "source": [ |
94 |
| - "! stash access-keys create cipherstash_getting_started_access_key" |
95 |
| - ] |
96 |
| - }, |
97 |
| - { |
98 |
| - "cell_type": "markdown", |
99 |
| - "id": "cb1c0f92-4d25-4840-9546-b14df14475bc", |
100 |
| - "metadata": {}, |
101 |
| - "source": [ |
102 |
| - "### Create a dataset\n", |
103 |
| - "\n", |
104 |
| - "> **NOTE**: If you already have a dataset and prefer to use that rather than create a new one, you can use it instead. However, it is recommended that you create one here to use with this notebook.\n", |
105 |
| - "\n", |
106 |
| - "After logging into your workspace, run the following command to create a new dataset, and note the **dataset ID**." |
107 |
| - ] |
108 |
| - }, |
109 |
| - { |
110 |
| - "cell_type": "code", |
111 |
| - "execution_count": null, |
112 |
| - "id": "0d3a062d-934d-4c8f-9602-06df26cdee62", |
113 |
| - "metadata": {}, |
114 |
| - "outputs": [], |
115 |
| - "source": [ |
116 |
| - "! stash datasets create cipherstash_getting_started" |
117 |
| - ] |
118 |
| - }, |
119 |
| - { |
120 |
| - "cell_type": "markdown", |
121 |
| - "id": "83021895-8447-4ced-8d1e-3697171c9495", |
122 |
| - "metadata": {}, |
123 |
| - "source": [ |
124 |
| - "### Create a client\n", |
125 |
| - "\n", |
126 |
| - "> **NOTE**: If you already have a client and prefer to use that rather than create a new one, you can use it instead. However, it is recommended that you create one here to use with this notebook.\n", |
127 |
| - "\n", |
128 |
| - "Set the `CS_DATASET_ID` to the dataset ID value from the command above.\n", |
129 |
| - "After that, run the command to create a client.\n", |
130 |
| - "Note the **Client ID** and **Client Key** in the output." |
131 |
| - ] |
132 |
| - }, |
133 |
| - { |
134 |
| - "cell_type": "code", |
135 |
| - "execution_count": null, |
136 |
| - "id": "6c1eb80b-5fda-4cf6-b59e-3ff87e3bbcb8", |
137 |
| - "metadata": {}, |
138 |
| - "outputs": [], |
139 |
| - "source": [ |
140 |
| - "%env CS_DATASET_ID=<dataset_id>" |
141 |
| - ] |
142 |
| - }, |
143 |
| - { |
144 |
| - "cell_type": "code", |
145 |
| - "execution_count": null, |
146 |
| - "id": "38c608ec-331e-4dec-ab44-caeabbc38d58", |
147 |
| - "metadata": { |
148 |
| - "scrolled": true |
149 |
| - }, |
150 |
| - "outputs": [], |
151 |
| - "source": [ |
152 |
| - "import os\n", |
153 |
| - "! stash clients create --dataset-id {os.environ['CS_DATASET_ID']} cipherstash_getting_started_client" |
154 |
| - ] |
155 |
| - }, |
156 |
| - { |
157 |
| - "cell_type": "markdown", |
158 |
| - "id": "fe337548-771c-4d62-a912-2a80e4f9a2d8", |
159 |
| - "metadata": {}, |
160 |
| - "source": [ |
161 |
| - "## Start the services (PostgreSQL + CipherStash Proxy)\n", |
162 |
| - "\n", |
163 |
| - "With the values for `CS_WORKSPACE_ID`, `CS_CLIENT_ACCESS_KEY`, `CS_ENCRYPTION__CLIENT_ID` and `CS_ENCRYPTION__CLIENT_KEY`, and `dataset.yml` uploaded, PostgreSQL and Cipherstash Proxy are ready to be started.\n", |
164 |
| - "\n", |
165 |
| - "Replace `<workspace_id>`, `<client_access_key>`, `<client_id>` and `<client_key>` with the values from the steps above and set those environment variables.\n", |
166 |
| - "After setting those variables, run the `docker compose` commands. docker compose should successfully start the database and Proxy." |
167 |
| - ] |
168 |
| - }, |
169 |
| - { |
170 |
| - "cell_type": "code", |
171 |
| - "execution_count": null, |
172 |
| - "id": "b082598f-acc8-47bc-b561-c0f07d059f4b", |
173 |
| - "metadata": {}, |
174 |
| - "outputs": [], |
175 |
| - "source": [ |
176 |
| - "%env CS_WORKSPACE_ID=<workspace_id>" |
177 |
| - ] |
178 |
| - }, |
179 |
| - { |
180 |
| - "cell_type": "code", |
181 |
| - "execution_count": null, |
182 |
| - "id": "e01757fa-0d70-4d53-b33d-88bf02449d3c", |
183 |
| - "metadata": {}, |
184 |
| - "outputs": [], |
185 |
| - "source": [ |
186 |
| - "%env CS_CLIENT_ACCESS_KEY=<client_access_key>" |
187 |
| - ] |
188 |
| - }, |
189 |
| - { |
190 |
| - "cell_type": "code", |
191 |
| - "execution_count": null, |
192 |
| - "id": "348e6430-dae7-4183-8eab-46315b622f1c", |
193 |
| - "metadata": {}, |
194 |
| - "outputs": [], |
195 |
| - "source": [ |
196 |
| - "%env CS_ENCRYPTION__CLIENT_ID=<client_id>" |
197 |
| - ] |
198 |
| - }, |
199 |
| - { |
200 |
| - "cell_type": "code", |
201 |
| - "execution_count": null, |
202 |
| - "id": "e8ac364e-98a1-4687-b11e-4b935b6d8b70", |
203 |
| - "metadata": {}, |
204 |
| - "outputs": [], |
205 |
| - "source": [ |
206 |
| - "%env CS_ENCRYPTION__CLIENT_KEY=a4627031a16b7065726d75746174696f6e9008090a040b000e050c0d020103060f076770325f66726f6da16b7065726d75746174696f6e900d04090e07050f0c030b0608000a01026570325f746fa16b7065726d75746174696f6e90030b0f08070201060d0c05090e00040a627033a16b7065726d75746174696f6e9821031018190a04020e0815181b181c18200c05181d14130900181e0d0712161701181a1818060f11181f0b" |
207 |
| - ] |
208 |
| - }, |
209 |
| - { |
210 |
| - "cell_type": "markdown", |
211 |
| - "id": "a1e7b418-3e0c-49b7-8d45-3fd22f9b94d5", |
212 |
| - "metadata": {}, |
213 |
| - "source": [ |
214 |
| - "### Start PostgreSQL\n", |
215 |
| - "\n", |
216 |
| - "If it is the first time starting those services, it is necesssary to start PostgreSQL and run some setup scripts (SQL files) before starting CpherStash Proxy." |
217 |
| - ] |
218 |
| - }, |
219 |
| - { |
220 |
| - "cell_type": "code", |
221 |
| - "execution_count": null, |
222 |
| - "id": "dd60b2fa-14c0-4206-b5c8-74b8d83b1086", |
223 |
| - "metadata": {}, |
224 |
| - "outputs": [], |
225 |
| - "source": [ |
226 |
| - "! docker compose up postgres -d" |
227 |
| - ] |
228 |
| - }, |
229 |
| - { |
230 |
| - "cell_type": "raw", |
231 |
| - "id": "be2faca5-11f9-46d2-a2f9-76b8afd5925b", |
232 |
| - "metadata": {}, |
233 |
| - "source": [ |
234 |
| - "The command above should start PostgreSQL.\n", |
235 |
| - "At any point, you can check the logs to see if there are any errors in your terminal window.\n", |
236 |
| - "From the directory where your docker-copmose.yml is located (`jupyter_notebook/` by default):\n", |
237 |
| - "\n", |
238 |
| - "> docker compose logs -f postgres" |
| 35 | + "In order to run the example, you will need to start CipherStash Proxy and PostgreSQL.\n", |
| 36 | + "You can use the [playground environment](../../playground/README.md) to do this." |
239 | 37 | ]
|
240 | 38 | },
|
241 | 39 | {
|
|
0 commit comments