From b610d81cd6659ddb7383f669ffc1a0cf6ec6e85d Mon Sep 17 00:00:00 2001 From: Ay1man2 Date: Tue, 7 May 2024 11:07:51 -0700 Subject: [PATCH 1/8] updated BYOWS docs (#1906) --- .docs/craig-code-engine.md | 45 +------------ .docs/power-vs-workspace-deployment.md | 87 +++++++++++++++++++++----- 2 files changed, 73 insertions(+), 59 deletions(-) diff --git a/.docs/craig-code-engine.md b/.docs/craig-code-engine.md index 31c76092..8b58f679 100644 --- a/.docs/craig-code-engine.md +++ b/.docs/craig-code-engine.md @@ -34,47 +34,4 @@ The Code Engine image build and application settings can be used to manage the C ## Bring your own Power VS workspace -### Background -You can bring your own existing Power VS workspace into CRAIG which allows you to choose custom images for Power VSIs. - -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. - -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. - -#### generate-env.sh prerequisites -- [jq](https://jqlang.github.io/jq/) v1.7 or higher -- ibmcloud CLI - -#### Downloading generate-env.sh in IBM Cloud Shell -From within IBM Cloud Shell run the following two commands to download the script and make it executable: -```bash -wget https://raw.githubusercontent.com/IBM/CRAIG/main/generate-env.sh -chmod 755 generate-env.sh -``` - -To generate an env containing all of the workspaces in your account, you can run the following command: - -``` -./generate-env.sh env -``` - -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 `env` file can then be used on the `deploy.sh` script: - -``` -./deploy.sh -e env -``` - -### Modifying the configmap -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. - -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: - -``` -ibmcloud resource service-instances --service-name power-iaas --output json | jq -r '.[]? | "\(.guid), \(.name), \(.region_id)"' -``` - -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. - -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. +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. diff --git a/.docs/power-vs-workspace-deployment.md b/.docs/power-vs-workspace-deployment.md index 0b35e781..275d15a6 100644 --- a/.docs/power-vs-workspace-deployment.md +++ b/.docs/power-vs-workspace-deployment.md @@ -3,17 +3,16 @@ 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. >* _**Note:** this only needs to be done once per IBM Cloud Account, not per user of CRAIG._ ->* _The deploy.sh script used to deploy CRAIG in IBM Code Engine can also automatically deploy the workspaces using its `-z` parameter._ +>* _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._ ## Prerequisites - [Create an IBM Cloud API Key](https://cloud.ibm.com/docs/account?topic=account-userapikey&interface=ui#create_user_key) -- [jq](https://jqlang.github.io/jq/) v1.7 or higher - - -
_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._ +_If runnning outside of IBM Cloud Shell:_ +- [jq](https://jqlang.github.io/jq/) v1.7 or higher +- ibmcloud cli -## Automated Deployment +## Automated Power VS Workspace Deployment for Local CRAIG Installations 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_=`. @@ -22,21 +21,79 @@ Use the following command to run the script: sh deploy/terraform.sh -a "" ``` -This will produce a file named `.env` that can be passed to the `deploy.sh` script when deploying CRAIG in Code Engine. +This will produce a file named `.env` in your local environment. -#### Bring Your Own Workspace +The `API_KEY` key and value should also be added to the `.env` file, see [.env.example](../.env.example) for more information. -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. -#### generate-env.sh prerequisites -- [jq](https://jqlang.github.io/jq/) v1.7 or higher -- [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-getting-started) +## Bring your own Power VS workspace -To generate a `.env` file containing all of the workspaces in your account, you can run the following command: +### Background +You can bring your own existing Power VS workspace into CRAIG which allows you to choose custom images for Power VSIs. +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. + +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. + +### Bring Your Own Workspace for CRAIG Code Engine Deployment Script + +#### 1. Download the generate-env.sh script within the IBM Cloud Shell +From within IBM Cloud Shell run the following two commands to download the script and make it executable: +```bash +wget https://raw.githubusercontent.com/IBM/CRAIG/main/generate-env.sh +chmod 755 generate-env.sh ``` -./generate-env.sh .env +#### 2. Run generate-env.sh to generate `env` file +To generate an `env` file containing all of the workspaces in your account, you can run the following command: + ``` +./generate-env.sh env +``` + +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. + +#### 3. Run deploy.sh using generated `env` file +The `env` file can then be used on the `deploy.sh` script: + +``` +./deploy.sh -e env +``` + +See our [README](../README.md#deploying-to-ibm-code-engine) for further instructions on how to run the deploy script. + +### Modifying the CRAIG Code Engine configmap Post-Deployment +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. -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. +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: + +``` +ibmcloud resource service-instances --service-name power-iaas --output json | jq -r '.[]? | "\(.guid), \(.name), \(.region_id)"' +``` + +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. + +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. + + +### Bring Your Own Workspace for local CRAIG installations + + +#### Prerequisites for running generate-env.sh locally +- [jq](https://jqlang.github.io/jq/) v1.7 or higher +- ibmcloud CLI + +#### 1. Navigate to your CRAIG root directory and make generate-env.sh executable + +```bash +chmod 755 generate-env.sh +``` +#### 2. Run generate-env.sh to generate `env` file +To generate an `env` file containing all of the workspaces in your account, you can run the following command: + +``` +./generate-env.sh env +``` +#### 3. Modify `env` file +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. +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. From 349940b352105ed7030d568de9de1c7f66c59dc1 Mon Sep 17 00:00:00 2001 From: Ay1man2 Date: Tue, 7 May 2024 13:03:42 -0700 Subject: [PATCH 2/8] Issue 1399: CRAIG Footer (#1900) * new footer wip * prettier formatting * added new Footer and styles, removed internal URLs from CRAIG v2 leftnav * prettier formatting * removed marginTop from footer * addressed changes * prettier formatting * added v2 query to URL * removed extra displayFlex from craigformgroup classname * fixed alignment of Documentation in 2nd Column * removed bold from tutorial text * added z-index to footer so it doesn't cover forms + gets overlayed in modal view * addressed Evelyn's changes * prettier formatting * fixed flexbox spacing and styling * prettier formatting * adjust logo size + center, add margin bottom between Tutorial and line * update changelog * updated to v 1.15.4, fixed changelog --- CHANGELOG.md | 6 ++ client/package-lock.json | 4 +- client/package.json | 2 +- .../components/page-template/BottomAbout.js | 77 ++++++++++++++++ .../src/components/page-template/LeftNav.js | 86 +++++++++--------- .../components/page-template/PageTemplate.js | 3 +- client/src/components/page-template/index.js | 1 + client/src/images/craigNoBackground.png | Bin 0 -> 24991 bytes client/src/index.scss | 44 +++++++++ client/src/lib/docs/release-notes.json | 6 ++ package-lock.json | 4 +- package.json | 2 +- unit-tests/forms/wizard.test.js | 24 ++--- 13 files changed, 198 insertions(+), 61 deletions(-) create mode 100644 client/src/components/page-template/BottomAbout.js create mode 100644 client/src/images/craigNoBackground.png diff --git a/CHANGELOG.md b/CHANGELOG.md index ac68e4e5..fd1d2565 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## 1.15.4 + +### Upgrade Notes + +- Updated footer for CRAIG v2 UI + ## 1.15.3 ### Upgrade Notes diff --git a/client/package-lock.json b/client/package-lock.json index 4993f68c..d77310c8 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1,12 +1,12 @@ { "name": "craig", - "version": "1.15.3", + "version": "1.15.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "craig", - "version": "1.15.3", + "version": "1.15.4", "license": "Apache-2.0", "dependencies": { "@apollo/client": "^3.4.10", diff --git a/client/package.json b/client/package.json index 3a653076..f33c3d1b 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "craig", - "version": "1.15.3", + "version": "1.15.4", "private": true, "license": "Apache-2.0", "scripts": { diff --git a/client/src/components/page-template/BottomAbout.js b/client/src/components/page-template/BottomAbout.js new file mode 100644 index 00000000..4d1669d2 --- /dev/null +++ b/client/src/components/page-template/BottomAbout.js @@ -0,0 +1,77 @@ +import { NewTab } from "@carbon/icons-react"; +import { Link } from "@carbon/react"; +import React from "react"; +import "../../index.scss"; +import craigNoBackground from "../../images/craigNoBackground.png"; +import { CraigFormGroup } from "../forms"; +import { contains } from "lazy-z"; + +const InternalLink = (props) => { + return ( + + {props.urlText} + + ); +}; + +const ExternalLink = (props) => { + return ( + } + target="_blank" + size="lg" + style={props.style} + > + {props.urlText} + + ); +}; + +const BottomAbout = () => { + let isV2Page = + contains(window.location.pathname, "/v2") || + contains(window.location.search, "v2"); + return ( +
+
+
+

CRAIG

+ + + + +
+
+ + + +
+
+ +
+
+
+

+ Created by the IBM Cloud Platinum Team +

+
+ ); +}; + +export default BottomAbout; diff --git a/client/src/components/page-template/LeftNav.js b/client/src/components/page-template/LeftNav.js index 514e8d1c..c5533764 100644 --- a/client/src/components/page-template/LeftNav.js +++ b/client/src/components/page-template/LeftNav.js @@ -213,49 +213,51 @@ class LeftNav extends React.Component { {this.props.expanded && ( <> {this.props.expanded && !isV2Page && ( - + <> + + + + + + )} - - - - {this.props.expanded && isV2Page && ( { jsonInCodeMirror={props.jsonInCodeMirror} /> + {isResetState !== true && !contains(window.location.pathname, "/v2") && (