Skip to content

Commit af33fab

Browse files
committed
Merge remote-tracking branch 'internal/main'
2 parents 4e70a39 + 7228e5e commit af33fab

36 files changed

+812
-624
lines changed

.docs/craig-code-engine.md

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -34,47 +34,4 @@ The Code Engine image build and application settings can be used to manage the C
3434

3535
## Bring your own Power VS workspace
3636

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:
50-
```bash
51-
wget https://raw.githubusercontent.com/IBM/CRAIG/main/generate-env.sh
52-
chmod 755 generate-env.sh
53-
```
54-
55-
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:
73-
74-
```
75-
ibmcloud resource service-instances --service-name power-iaas --output json | jq -r '.[]? | "\(.guid), \(.name), \(.region_id)"'
76-
```
77-
78-
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.

.docs/power-vs-workspace-deployment.md

Lines changed: 72 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
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.
44

55
>* _**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._
77
88
## Prerequisites
99
- [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._
1410

11+
_If runnning outside of IBM Cloud Shell:_
12+
- [jq](https://jqlang.github.io/jq/) v1.7 or higher
13+
- ibmcloud cli
1514

16-
## Automated Deployment
15+
## Automated Power VS Workspace Deployment for Local CRAIG Installations
1716

1817
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>`.
1918

@@ -22,21 +21,79 @@ Use the following command to run the script:
2221
sh deploy/terraform.sh -a "<Your IBM Cloud Platform API key>"
2322
```
2423

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.
2625

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.
2827

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.
3028

31-
#### generate-env.sh prerequisites
32-
- [jq](https://jqlang.github.io/jq/) v1.7 or higher
33-
- [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-getting-started)
29+
## Bring your own Power VS workspace
3430

35-
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.
3633

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:
42+
```bash
43+
wget https://raw.githubusercontent.com/IBM/CRAIG/main/generate-env.sh
44+
chmod 755 generate-env.sh
3745
```
38-
./generate-env.sh .env
46+
#### 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+
3949
```
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.
4066

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:
68+
69+
```
70+
ibmcloud resource service-instances --service-name power-iaas --output json | jq -r '.[]? | "\(.guid), \(.name), \(.region_id)"'
71+
```
72+
73+
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.
4298

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.

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## 1.15.4
6+
7+
### Upgrade Notes
8+
9+
- Updated footer for CRAIG v2 UI
10+
- A LogDNA ingestion key is now created and output when LogDNA is enabled instead of a resource key
11+
12+
### Fixes
13+
14+
- Fixed an issue causing Power VS images from data to reference the invalid value `image_id` instead of the correct `id`
15+
- Fixed an issue preventing Terraform from creating multiple VPEs in the same VPC
16+
517
## 1.15.3
618

719
### Upgrade Notes
@@ -11,6 +23,7 @@ All notable changes to this project will be documented in this file.
1123
### Features
1224

1325
- Users can integrate Security and Compliance Center with Cloud Object storage from the `/forms/sccV2` page
26+
- Power Edge Router is now supported for `tor01` and `us-south`
1427

1528
### Fixes
1629

client/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "craig",
3-
"version": "1.15.3",
3+
"version": "1.15.4",
44
"private": true,
55
"license": "Apache-2.0",
66
"scripts": {
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import { NewTab } from "@carbon/icons-react";
2+
import { Link } from "@carbon/react";
3+
import React from "react";
4+
import "../../index.scss";
5+
import craigNoBackground from "../../images/craigNoBackground.png";
6+
import { CraigFormGroup } from "../forms";
7+
import { contains } from "lazy-z";
8+
9+
const InternalLink = (props) => {
10+
return (
11+
<Link href={props.url} size="lg" style={props.style}>
12+
{props.urlText}
13+
</Link>
14+
);
15+
};
16+
17+
const ExternalLink = (props) => {
18+
return (
19+
<Link
20+
href={props.url}
21+
renderIcon={() => <NewTab data-modal-primary-focus />}
22+
target="_blank"
23+
size="lg"
24+
style={props.style}
25+
>
26+
{props.urlText}
27+
</Link>
28+
);
29+
};
30+
31+
const BottomAbout = () => {
32+
let isV2Page =
33+
contains(window.location.pathname, "/v2") ||
34+
contains(window.location.search, "v2");
35+
return (
36+
<div className="newFooter pointerEventsAuto">
37+
<div className="newFooterFlexRow marginBottomSmall">
38+
<div className="newFooterFlexColumn">
39+
<h1 className="marginBottomSmall">CRAIG</h1>
40+
<InternalLink
41+
url={`/docs/about${isV2Page ? "?v2" : ""}`}
42+
urlText="About"
43+
/>
44+
<InternalLink
45+
url={`/docs/releaseNotes${isV2Page ? "?v2" : ""}`}
46+
urlText="Release Notes"
47+
/>
48+
<InternalLink
49+
url={`/docs/json${isV2Page ? "?v2" : ""}`}
50+
urlText="JSON Documentation"
51+
/>
52+
<InternalLink url="/docs/tutorial" urlText="Tutorial" />
53+
</div>
54+
<div className="newFooterFlexColumn marginTopSkipRow">
55+
<ExternalLink url="https://github.com/IBM/CRAIG" urlText="Github" />
56+
<ExternalLink
57+
url="https://github.com/IBM/CRAIG/blob/main/README.md"
58+
urlText="README"
59+
/>
60+
<ExternalLink
61+
url="https://github.com/IBM/CRAIG/tree/main/.docs"
62+
urlText="Documentation"
63+
/>
64+
</div>
65+
<div className="newFooterLogoColumn">
66+
<img src={craigNoBackground} width="190" height="190" />
67+
</div>
68+
</div>
69+
<hr width="99%"></hr>
70+
<p className="newFooterBottomText italic">
71+
Created by the IBM Cloud Platinum Team
72+
</p>
73+
</div>
74+
);
75+
};
76+
77+
export default BottomAbout;

client/src/components/page-template/LeftNav.js

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -213,49 +213,51 @@ class LeftNav extends React.Component {
213213
{this.props.expanded && (
214214
<>
215215
{this.props.expanded && !isV2Page && (
216-
<LeftNavItem
217-
key="V2"
218-
item={{
219-
path: "/v2/projects",
220-
icon: DrillThrough,
221-
title: "[New] Use Craig V2",
222-
}}
223-
expanded={this.props.expanded}
224-
new
225-
/>
216+
<>
217+
<LeftNavItem
218+
key="V2"
219+
item={{
220+
path: "/v2/projects",
221+
icon: DrillThrough,
222+
title: "[New] Use Craig V2",
223+
}}
224+
expanded={this.props.expanded}
225+
new
226+
/>
227+
<LeftNavItem
228+
item={{ path: "/docs/about", icon: Help, title: "About" }}
229+
key="About"
230+
expanded={this.props.expanded}
231+
/>
232+
<LeftNavItem
233+
item={{
234+
path: "/docs/releaseNotes",
235+
icon: Bullhorn,
236+
title: "Release Notes",
237+
}}
238+
key="ReleaseNotes"
239+
expanded={this.props.expanded}
240+
/>
241+
<LeftNavItem
242+
item={{
243+
path: "/docs/json",
244+
icon: JsonReference,
245+
title: "JSON Documentation",
246+
}}
247+
key="json-docs"
248+
expanded={this.props.expanded}
249+
/>
250+
<LeftNavItem
251+
item={{
252+
path: "/docs/tutorial",
253+
icon: Compass,
254+
title: "Tutorial",
255+
}}
256+
key="tutorial"
257+
expanded={this.props.expanded}
258+
/>
259+
</>
226260
)}
227-
<LeftNavItem
228-
item={{ path: "/docs/about", icon: Help, title: "About" }}
229-
key="About"
230-
expanded={this.props.expanded}
231-
/>
232-
<LeftNavItem
233-
item={{
234-
path: "/docs/releaseNotes",
235-
icon: Bullhorn,
236-
title: "Release Notes",
237-
}}
238-
key="ReleaseNotes"
239-
expanded={this.props.expanded}
240-
/>
241-
<LeftNavItem
242-
item={{
243-
path: "/docs/json",
244-
icon: JsonReference,
245-
title: "JSON Documentation",
246-
}}
247-
key="json-docs"
248-
expanded={this.props.expanded}
249-
/>
250-
<LeftNavItem
251-
item={{
252-
path: "/docs/tutorial",
253-
icon: Compass,
254-
title: "Tutorial",
255-
}}
256-
key="tutorial"
257-
expanded={this.props.expanded}
258-
/>
259261
{this.props.expanded && isV2Page && (
260262
<LeftNavItem
261263
key="V2"

client/src/components/page-template/PageTemplate.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import {
5555
getObjectFromArray,
5656
isBoolean,
5757
} from "lazy-z";
58-
import { CraigCodeMirror, Navigation, Footer } from ".";
58+
import { CraigCodeMirror, Navigation, Footer, BottomAbout } from ".";
5959
import PropTypes from "prop-types";
6060
import "./page-template.css";
6161
import { codeMirrorGetDisplay } from "../../lib";
@@ -327,6 +327,7 @@ const PageTemplate = (props) => {
327327
jsonInCodeMirror={props.jsonInCodeMirror}
328328
/>
329329
</div>
330+
<BottomAbout />
330331
{isResetState !== true && !contains(window.location.pathname, "/v2") && (
331332
<Footer
332333
toggleFooter={() => {

0 commit comments

Comments
 (0)