You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .docs/craig-code-engine.md
+1-44Lines changed: 1 addition & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -34,47 +34,4 @@ The Code Engine image build and application settings can be used to manage the C
34
34
35
35
## Bring your own Power VS workspace
36
36
37
-
### Background
38
-
You can bring your own existing Power VS workspace into CRAIG which allows you to choose custom images for Power VSIs.
39
-
40
-
The IBM Code Engine deployment script will automatically create Power VS workspaces in every Power VS zone worldwide for CRAIG's use when using the `-z` parameter.
41
-
42
-
If you do not want Power VS workspaces created in every zone, you can create the Power VS Workspaces in your chosen zone(s) using the Clould console, CLI, or other means. The [generate-env.sh](../generate-env.sh) script can generate an environment file that can be used with the `deploy.sh` script to configure CRAIG to use the workspaces.
43
-
44
-
#### generate-env.sh prerequisites
45
-
-[jq](https://jqlang.github.io/jq/) v1.7 or higher
46
-
- ibmcloud CLI
47
-
48
-
#### Downloading generate-env.sh in IBM Cloud Shell
49
-
From within IBM Cloud Shell run the following two commands to download the script and make it executable:
To generate an env containing all of the workspaces in your account, you can run the following command:
56
-
57
-
```
58
-
./generate-env.sh env
59
-
```
60
-
61
-
The `env` file should then be modified to remove or comment out any workspaces that CRAIG should not use, and to ensure it contains only one workspace per zone.
62
-
63
-
The `env` file can then be used on the `deploy.sh` script:
64
-
65
-
```
66
-
./deploy.sh -e env
67
-
```
68
-
69
-
### Modifying the configmap
70
-
If you want to bring your own workspace after CRAIG deployment in Code Engine you can update the configmap with the GUID of your workspace.
71
-
72
-
To find the GUIDs and locations of your workspaces, the following IBM Cloud CLI command can be run in a terminal window or an IBM Cloud Shell:
To modify the configmap to add your workspace GUID, click on `Secrets and configmaps` on left navigation pane of the Code Engine project. Click on the `craig-env` Configmap. Find the key that matches your workspace's zone and set your workspace's GUID as the value for the key. Click the `Save` button. The CRAIG instance can then be [redeployed](#redeploying-the-craig-instance) to pick up the configmap change.
79
-
80
-
If CRAIG was deployed without specifying `-z` or `-e`, a configmap can be manually created and set with the correct key-value for the zone. See the [.env.example](../.env.example) for the possible keys and the [IBM Code Engine documentation](https://cloud.ibm.com/docs/codeengine?topic=codeengine-configmap) for how to create the configmap and add the reference to the `craig` application.
37
+
For more information on how to bring your own Power VS workspaces to CRAIG, refer to our [power-vs-workspace-deployment.md](./power-vs-workspace-deployment.md) documentation.
Copy file name to clipboardExpand all lines: .docs/power-vs-workspace-deployment.md
+72-15Lines changed: 72 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -3,17 +3,16 @@
3
3
To dynamically fetch Power VS images and storage pools within CRAIG, the IBM Power VS APIs require a workspace to be created. CRAIG provides Terraform scripts to automatically provision these workspaces and an environment file that can be used for both IBM Code Engine deployments and local deployments.
4
4
5
5
>*_**Note:** this only needs to be done once per IBM Cloud Account, not per user of CRAIG._
6
-
>*_The deploy.sh script used to deploy CRAIG in IBM Code Engine can also automatically deploy the workspaces using its `-z` parameter._
6
+
>*_The `deploy.sh` script used to deploy CRAIG in IBM Code Engine can also automatically deploy the workspaces using its `-z` parameter. See our [README](../README.md#deploying-to-ibm-code-engine) for further instructions on how to run the deploy script._
7
7
8
8
## Prerequisites
9
9
-[Create an IBM Cloud API Key](https://cloud.ibm.com/docs/account?topic=account-userapikey&interface=ui#create_user_key)
10
-
-[jq](https://jqlang.github.io/jq/) v1.7 or higher
11
-
12
-
13
-
<br /> _Note: If you plan on [deploying CRAIG To IBM Code Engine](../README.md#deploying-to-ibm-code-engine), ensure you are using the same account you intend to use for CRAIG deployment in Code Engine when creating the API key and doing the PowerVS Workspace Deployment setup below._
14
10
11
+
_If runnning outside of IBM Cloud Shell:_
12
+
-[jq](https://jqlang.github.io/jq/) v1.7 or higher
13
+
- ibmcloud cli
15
14
16
-
## Automated Deployment
15
+
## Automated Power VS Workspace Deployment for Local CRAIG Installations
17
16
18
17
The `terraform.sh` script found in the `/deploy` folder of the CRAIG root directory provisions a Power VS Workspace in each zone worldwide and sets the needed environment variables with the format of `POWER_WORKSPACE_<zone>=<workspace-guid>`.
19
18
@@ -22,21 +21,79 @@ Use the following command to run the script:
22
21
sh deploy/terraform.sh -a "<Your IBM Cloud Platform API key>"
23
22
```
24
23
25
-
This will produce a file named `.env`that can be passed to the `deploy.sh` script when deploying CRAIG in Code Engine.
24
+
This will produce a file named `.env`in your local environment.
26
25
27
-
#### Bring Your Own Workspace
26
+
The `API_KEY` key and value should also be added to the `.env` file, see [.env.example](../.env.example) for more information.
28
27
29
-
If you do not want Power VS workspaces created in every zone or if you want to use custom images you can bring your own Power VS Workspace into CRAIG. The [generate-env.sh](../generate-env.sh) script can generate a `.env` environment file containing all of the workspaces in your account.
30
28
31
-
#### generate-env.sh prerequisites
32
-
-[jq](https://jqlang.github.io/jq/) v1.7 or higher
To generate a `.env` file containing all of the workspaces in your account, you can run the following command:
31
+
### Background
32
+
You can bring your own existing Power VS workspace into CRAIG which allows you to choose custom images for Power VSIs.
36
33
34
+
The IBM Code Engine deployment script will automatically create Power VS workspaces in every Power VS zone worldwide for CRAIG's use when using the `-z` parameter.
35
+
36
+
If you do not want Power VS workspaces created in every zone, you can create the Power VS Workspaces in your chosen zone(s) using the Clould console, CLI, or other means. The [generate-env.sh](../generate-env.sh) script can generate an environment file that can be used with the `deploy.sh` script to configure CRAIG to use the workspaces.
37
+
38
+
### Bring Your Own Workspace for CRAIG Code Engine Deployment Script
39
+
40
+
#### 1. Download the generate-env.sh script within the IBM Cloud Shell
41
+
From within IBM Cloud Shell run the following two commands to download the script and make it executable:
#### 2. Run generate-env.sh to generate `env` file
47
+
To generate an `env` file containing all of the workspaces in your account, you can run the following command:
48
+
39
49
```
50
+
./generate-env.sh env
51
+
```
52
+
53
+
The `env` file should then be modified to remove or comment out any workspaces that CRAIG should not use, and to ensure it contains only one workspace per zone.
54
+
55
+
#### 3. Run deploy.sh using generated `env` file
56
+
The `env` file can then be used on the `deploy.sh` script:
57
+
58
+
```
59
+
./deploy.sh -e env
60
+
```
61
+
62
+
See our [README](../README.md#deploying-to-ibm-code-engine) for further instructions on how to run the deploy script.
63
+
64
+
### Modifying the CRAIG Code Engine configmap Post-Deployment
65
+
If you want to bring your own workspace after CRAIG deployment in Code Engine you can update the configmap with the GUID of your workspace.
40
66
41
-
The `.env` file should then be modified to remove or comment out any workspaces that CRAIG should not use, and to ensure it contains only one workspace per zone. The `API_KEY` key and value should also be added to the file, see [.env.example](../.env.example) for more information.
67
+
To find the GUIDs and locations of your workspaces, the following IBM Cloud CLI command can be run in a terminal window or an IBM Cloud Shell:
To modify the configmap to add your workspace GUID, click on `Secrets and configmaps` on left navigation pane of the Code Engine project. Click on the `craig-env` Configmap. Find the key that matches your workspace's zone and set your workspace's GUID as the value for the key. Click the `Save` button. The CRAIG instance can then be [redeployed](#redeploying-the-craig-instance) to pick up the configmap change.
74
+
75
+
If CRAIG was deployed without specifying `-z` or `-e`, a configmap can be manually created and set with the correct key-value for the zone. See the [.env.example](../.env.example) for the possible keys and the [IBM Code Engine documentation](https://cloud.ibm.com/docs/codeengine?topic=codeengine-configmap) for how to create the configmap and add the reference to the `craig` application.
76
+
77
+
78
+
### Bring Your Own Workspace for local CRAIG installations
79
+
80
+
81
+
#### Prerequisites for running generate-env.sh locally
82
+
-[jq](https://jqlang.github.io/jq/) v1.7 or higher
83
+
- ibmcloud CLI
84
+
85
+
#### 1. Navigate to your CRAIG root directory and make generate-env.sh executable
86
+
87
+
```bash
88
+
chmod 755 generate-env.sh
89
+
```
90
+
#### 2. Run generate-env.sh to generate `env` file
91
+
To generate an `env` file containing all of the workspaces in your account, you can run the following command:
92
+
93
+
```
94
+
./generate-env.sh env
95
+
```
96
+
#### 3. Modify `env` file
97
+
The `env` file should then be modified to remove or comment out any workspaces that CRAIG should not use, and to ensure it contains only one workspace per zone. The `API_KEY` key and value should also be added to the file, see [.env.example](../.env.example) for more information.
42
98
99
+
If you're using your CRAIG directory in source control, ensure you also rename the `env` file to `.env` to make it hidden and recognized by `.gitignore` to avoid uploading sensitive data to Github.
0 commit comments