Skip to content

Commit

Permalink
WMS ID: 11407 / LiveLabs Documentation updated as per Latest CD3 tool…
Browse files Browse the repository at this point in the history
…kit (#424)

* setup-the-toolkit.md

* Add files via upload

* Update introduction.md

* Update introduction.md

* Update setup-the-toolkit.md

* Update deploy-compute-cli.md

* Update add-resource.md

* Update create-eventalarm.md

* Update upload-resourcemanager.md

* Add files via upload

* Update deploy-compute-jenkins.md

* Update deploy-compute-jenkins.md

* Update setup-the-toolkit.md

* Add files via upload

* Update setup-the-toolkit.md

* Update setup-the-toolkit.md

* Update deploy-compute-jenkins.md

* Update deploy-compute-cli.md

* Update deploy-compute-jenkins.md

* Update add-resource.md

* Update deploy-compute-jenkins.md

* Delete cd3-automation-toolkit/deploy-compute-jenkins/images/jen_cr_res_v1.png

* Add files via upload

* Add files via upload

* Update deploy-compute-jenkins.md

* Update deploy-compute-cli.md

* Update setup-the-toolkit.md

* Update setup-the-toolkit.md

---------

Co-authored-by: Dipesh Rathod <[email protected]>
  • Loading branch information
rpgandhari and dipeshrath authored Oct 7, 2024
1 parent c455f23 commit f4d3176
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In this lab, you will:

### 1. **Identity**

1. Choose CD3-CIS-template from [CD3 Excel templates](https://github.com/oracle-devrel/cd3-automation-toolkit/blob/main/cd3_automation_toolkit/documentation/user_guide/ExcelTemplates.md).
1. Choose CD3-CIS-template from [CD3 Excel templates](https://oracle-devrel.github.io/cd3-automation-toolkit/latest/excel-templates/).

>**Note:** Any template other than *CD3-CIS-ManagementServices-template* can be used to provision these services.
Expand Down Expand Up @@ -135,7 +135,7 @@ In this lab, you will:
- Create bash file "web.sh" under below path and copy sample script to enable Apache on the instance.
```
/cd3user/tenancies/<customer_name>/terraform_files/<region_name>/compute/scripts
/cd3user/tenancies/<prefix>/terraform_files/<region_name>/compute/scripts
```
```
Expand Down Expand Up @@ -190,4 +190,4 @@ You may now __proceed to the next lab__.
- __Author__ - Dipesh Rathod
- __Contributors__ - Murali N V, Suruchi Singla, Lasya Vadavalli
- __Last Updated By/Date__ - Dipesh Rathod, Mar 2024
- __Last Updated By/Date__ - Dipesh Rathod, Mar 2024
6 changes: 3 additions & 3 deletions cd3-automation-toolkit/create-eventalarm/create-eventalarm.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ Please follow the previous lab till the last step. Once you are able to provisio
1. Place *CD3-CIS-ManagementServices-template.xlsx* Excel sheet at appropriate location in your container and provide the corresponding path in cd3file parameter at below path.
```
/cd3user/tenancies /<customer_name>/<customer_name>_setUpOCI.properties
/cd3user/tenancies /<prefix>/<prefix>_setUpOCI.properties
e.g. cd3file=/cd3user/tenancies/usr1_livelab/CD3-CIS-ManagementServices-template.xlsx
```
2. *Execute* the setUpOCI Script from below path:
```
python setUpOCI.py /cd3user/tenancies/<customer_name>/<customer_name>_setUpOCI.properties
python setUpOCI.py /cd3user/tenancies/<prefix>/<prefix>_setUpOCI.properties
e.g. cd3file=/cd3user/tenancies/usr1_livelab/CD3-CIS-ManagementServices-template.xlsx
```
Expand All @@ -63,7 +63,7 @@ Please follow the previous lab till the last step. Once you are able to provisio
4. Once the execution is *successful*, tfvars file will be generated under below folder in that region.
```
<customer_name>_events.auto.tfvars file under /cd3user/tenancies/<customer_name>/terraform_files/<region_dir>
<prefix>_events.auto.tfvars file under /cd3user/tenancies/<prefix>/terraform_files/<region_dir>
```
5. Navigate to the above path and *execute* the terraform commands:
Expand Down
14 changes: 8 additions & 6 deletions cd3-automation-toolkit/deploy-compute-cli/deploy-compute-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ In this lab, you will:

# Create Resources using CLI

## Task 1: Add Excel path to 'customername_setUpoci.properties'
## Task 1: Add Excel path to 'prefix_setUpOCI.properties'

Note: Please check the tenancyconfig.properties file for prefix information

1. Add the Excel file path for "cd3file" parameter. You can find a file in below location.

```
/cd3user/tenancies/<customer_name>_setUpOCI.properties
/cd3user/tenancies/<prefix>_setUpOCI.properties
```
2. Set below parameter to *create_resources*, since we are creating new resources, and not modifying any existing ones.
Expand All @@ -46,7 +48,7 @@ In this lab, you will:
```
cd /cd3user/oci_tools/cd3_automation_toolkit/
python setUpOCI.py /cd3user/tenancies/<customer_name>/<customer_name>_setUpOCI.properties
python setUpOCI.py /cd3user/tenancies/<prefix>/<prefix>_setUpOCI.properties
```
## Task 3: Generate terraform files and create our resources in OCI
Expand All @@ -57,7 +59,7 @@ In this lab, you will:
2. Navigate to identity directory under home region directory after Terraform files are created.
```
cd /cd3user/tenancies/<customer_name>/terraform_files/<home_region>/identity
cd /cd3user/tenancies/<prefix>/terraform_files/<home_region>/identity
```
3. Execute terraform init, plan and apply to create the compartment.
Expand All @@ -84,7 +86,7 @@ In this lab, you will:
6. Once the Terraform files are created from above step, navigate to below path for each of the services: Network, Compute, Database and Block volume.
```
/cd3user/tenancies/<customer_name>/terraform_files/<region>/<services>
/cd3user/tenancies/<prefix>/terraform_files/<region>/<services>
```
7. Enter into each of the required service folders (network, compute, database) and execute the below terraform commands to provision the resources in OCI.
Expand All @@ -109,4 +111,4 @@ You may now __proceed to the next lab__.
- __Author__ - Lasya Vadavalli
- __Contributors__ - Murali N V, Suruchi Singla, Dipesh Rathod
- __Last Updated By/Date__ - Dipesh Rathod, Mar 2024
- __Last Updated By/Date__ - Dipesh Rathod, Mar 2024
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,23 @@ In this lab, you will:

>**Note:** Only one user at a time using the Jenkins setup is supported in the current release of the toolkit.
## Task 1: Add Excel path to 'customername_setUpoci.properties'
## Task 1: Add Excel path to 'prefix_setUpoci.properties'
1. **Login** to Jenkins URL with the user created after initialization.
2. **Click** on setUpOCI pipeline from Dashboard.
3. **Click** on **Build with Parameters** from left side menu.
2. **Click** on Prefix Name from Dashboard
3. **Click** on setUpOCI pipeline.
4. **Click** on **Build with Parameters** from left side menu.

![BUILDPARAM](./images/jen_cr_build_param.png "Build Parameter")
![BUILDPARAM](./images/jen_cr_build_param_v1.png "Build Parameter")

4. **Upload** the filled [Excel sheet](https://github.com/oracle-devrel/cd3-automation-toolkit/blob/main/cd3_automation_toolkit/documentation/user_guide/ExcelTemplates.md) in Excel_Template section.
5. **Upload** the filled [Excel sheet](https://oracle-devrel.github.io/cd3-automation-toolkit/latest/excel-templates/) in Excel_Template section.

![EXCELTEMP](./images/jen_cr_excel_temp.png "Excel Template")
![EXCELTEMP](./images/jen_cr_excel_temp_v1.png "Excel Template")

## Task 2: Execute setUpOCI.py
1. Select the workflow as Create Resources in OCI (Greenfield Workflow). Choose single or multiple MainOptions as required and then corresponding SubOptions.
>**Note:** Please read while selcting multiple options simultaneously. Below screenshot shows example to create compartments and Tags.
>**Note:** Please read while selecting multiple options simultaneously. Below screenshot shows example to create compartments.
![CREATRES](./images/jen_cr_res.png "Create Resource")
![CREATRES](./images/jen_cr_res_v1.png "Create Resource")

6. Click on **Build** at the bottom.

Expand All @@ -49,7 +50,7 @@ In this lab, you will:
1. You could also navigate terraform-apply pipeline as example below.
>**Note:** terraform_files » phoenix » tagging » terraform-apply
![CREATSTG](./images/jen_cr_stage.png "Stage of Resources")
![CREATSTG](./images/jen_cr_stage_v1.png "Stage of Resources")

2. **Review Logs** for Terraform Plan and OPA stages by clicking on the stage and then **Logs**.

Expand All @@ -68,4 +69,4 @@ You may now __proceed to the next lab__.

- __Author__ - Dipesh Rathod
- __Contributors__ - Murali N V, Suruchi Singla, Dipesh Rathod
- __Last Updated By/Date__ - Dipesh Rathod, Mar 2024
- __Last Updated By/Date__ - Dipesh Rathod, Mar 2024
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions cd3-automation-toolkit/introduction/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Estimated Workshop Time: 60 Minutes
In this workshop, you will learn how to:
- Get Started with CD3 Automation Toolkit
- Build OCI infrastructure using CD3 Automation Toolkit
- Produce and Inspect Terraform Plan
- Produce and Inspect Terraform Plan (Both Terarform and Tofu are supported by the toolkit, we will use Terraform for this labs)
- Apply Plan to OCI tenancy
- OCI Resource Manager Upload
- Terraform Destroy to reset
Expand All @@ -28,7 +28,7 @@ This lab has the following pre-requisites:

## The CD3 Automation Toolkit Architecture

![CD3 Automation Toolkit Architecture](images/cd3_architecture.png "CD3 Automation Toolkit Architecture")
![CD3 Automation Toolkit Architecture](images/CD3-Process.png "CD3 Automation Toolkit Architecture")

### Overview

Expand Down Expand Up @@ -70,4 +70,4 @@ Most of the resources in OCI can be provisioned with Terraform. While beyond the

- __Author__ - Dipesh Rathod
- __Contributors__ - Murali N V, Suruchi Singla, Lasya Vadavalli
- __Last Updated By/Date__ - Dipesh Rathod, May 2023
- __Last Updated By/Date__ - Dipesh Rathod, May 2023
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 56 additions & 10 deletions cd3-automation-toolkit/setup-the-toolkit/setup-the-toolkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The objectives of this lab are:

Below is a sample output:

![rmstackoutput](./images/rmstackoutput.png)
![rmstackoutput](./images/rmstackoutput_v1.png)


After executing the container, jump to [Task 3](#task-3-connect-container-to-oci-tenancy) to connect this container to OCI tenancy.
Expand Down Expand Up @@ -108,7 +108,8 @@ Make sure the [prerequisites](#prerequisites) are met before proceeding.

- Paste the contents of the **PEM public key** in the dialog box and click **Add**.

3. Open *tenancyconfig.properties* file and fill the details in **Required parameters** and **Auth Details Parameters** sections.
3. Navigate to ```/cd3user/oci_tools/cd3_automation_toolkit/user-scripts/```
4. Edit ```tenancyconfig.properties``` file and fill the details in **Required parameters** and **Auth Details Parameters** sections.

Below are the sample values for **API_Key Auth mechanism**.

Expand All @@ -120,7 +121,7 @@ Make sure the [prerequisites](#prerequisites) are met before proceeding.
# Friendly name for the Customer Tenancy eg: demotenancy; The generated .auto.tfvars files will be prefixed with this
# customer_name.
customer_name=demo_tenancy
prefix=rg-sep
tenancy_ocid=ocid1.tenancy.oc1.....niuea
Expand All @@ -147,26 +148,71 @@ Make sure the [prerequisites](#prerequisites) are met before proceeding.
>**Note:** If you selected Instance Principal or session token method for authentication, follow the commented guidelines in the *tenancyconfig.properties* file or [Auth Mechanisms documentation](https://github.com/oracle-devrel/cd3-automation-toolkit) and proceed accordingly.


4. Under **Deployment Parameters** section in tenancyconfig.properties file, Leave the default value for **outdir structure file** parameter to group your generated terraform auto.tfvars files for each service.
5. Under **Deployment Parameters** section in ```tenancyconfig.properties``` file, Leave the default value for **outdir structure file** parameter to group your generated terraform auto.tfvars files for each service.

>**Note:** To place all the generated terraform auto.tfvars files directly under the region folder, comment the parameter with the default outdirectory structure file path and uncomment the one above it.


5. Under **Advanced parameters for DevOps** section in tenancyconfig.properties file set the parameter ```use_oci_devops_git=yes``` to use the toolkit with **Jenkins**.
6. Under **Advanced parameters for DevOps** section in tenancyconfig.properties file set the parameter ```use_oci_devops_git=yes``` to use the toolkit with **Jenkins**.

>**Note:** If you plan to use the toolkit with CLI, skip this section. Since we are using API-key Auth mechanism, the **User details** section can be skipped.

6. **Initialise** your environment to use the Automation Toolkit.
7. **Initialise** your environment to use the Automation Toolkit.

```bash
python createTenancyConfig.py tenancyconfig.properties
```

7. You should see an output similar to below:
8. You should see an output similar to below:

```bash
[cd3user@109c63ee4ec0 user-scripts]$ python createTenancyConfig.py tenancyconfig.properties
=================================================================
NOTE: Make sure the API Public Key is added to the OCI Console!!!
=================================================================
Using different directories for OCI services as per the input outdir_structure_file..........
Copying Private Key File..........
Creating Tenancy specific config.................
Updated OCI_Regions file !!!
Creating Tenancy specific remote tfstate Items - bucket, S3 credentials.................
Creating new customer secret key
Creating Tenancy specific setUpOCI.properties.................
Creating Tenancy specific region directories, terraform provider , variables files.................
Creating Tenancy specific DevOps Items - Topic, Project and Repository.................
The toolkit has been setup successfully. !!!
Customer Specific Working Directory Path: /cd3user/tenancies/rg-sep
Remote State Bucket Name: rg-sep-automation-toolkit-bucket in us-sanjose-1.
Common Jenkins Home: /cd3user/tenancies/jenkins_home
DevOps Project Name and Repo Name: rg-sep-automation-toolkit-project, rg-sep-automation-toolkit-repo in us-sanjose-1.
Folder configured for OCI DevOps GIT: /cd3user/tenancies/rg-sep/terraform_files/ Initial Commit ID from createTenancyConfig.py: df73e44
#########################################
Next Steps for using toolkit via Jenkins
#########################################
Start Jenkins using - /usr/share/jenkins/jenkins.sh &
Access Jenkins using - https://<IP Address of the machine hosting docker container>:8443
######################################
Next Steps for using toolkit via CLI
######################################
Modify /cd3user/tenancies/rg-sep/rg-sep_setUpOCI.properties with input values for cd3file and workflow_type
cd /cd3user/oci_tools/cd3_automation_toolkit/
python setUpOCI.py /cd3user/tenancies/rg-sep/rg-sep_setUpOCI.properties
==================================================================================================================================
```

![tenancyconfigoutput](./images/tenancyconfigoutput.png)

8. After the createTenancyConfig.py script is successfully executed, customer specific files are created under ```/cd3user/tenancies/<customer_name>```.
10. After the createTenancyConfig.py script is successfully executed, customer specific files are created under ```/cd3user/tenancies/<prefix>```.

In this lab, we have learnt how to **setup CD3 toolkit container** and **connect** it to OCI tenancy.

Expand All @@ -176,4 +222,4 @@ You may now __proceed to the next lab__.

- __Author__ - Lasya Vadavalli
- __Contributors__ - Murali N V, Suruchi Singla, Dipesh Rathod
- __Last Updated By/Date__ - Lasya Vadavalli, Mar 2024
- __Last Updated By/Date__ - Lasya Vadavalli, Mar 2024
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Please follow the previous lab till the last step. Once you are able to provisio

1. Execute the *setUpOCI* Script:
```
python setUpOCI.py /cd3user/tenancies/<customer_name>/<customer_name>_setUpOCI.properties
python setUpOCI.py /cd3user/tenancies/<prefix>/<prefix>_setUpOCI.properties
e.g. python setUpOCI.py /cd3user/tenancies/usr1_livelab/usr1_livelab_setUpOCI.properties
```
Expand All @@ -30,7 +30,7 @@ Please follow the previous lab till the last step. Once you are able to provisio
3. Once the *execution* is successful, you will see the below stack in resource manager and file will be generated under the folder.
```
<customer_name>-<region_dir>-stacks.zip file will be generated under the folder /cd3user/tenancies/<customer_name>/terraform_files/<region_dir>
<prefix>-<region_dir>-stacks.zip file will be generated under the folder /cd3user/tenancies/<prefix>/terraform_files/<region_dir>
```
4. Go to *OCI console* under compartment which was selected for upload and take a few moments to explore the stack created.
Expand Down

0 comments on commit f4d3176

Please sign in to comment.