Skip to content

Commit

Permalink
Documentation update (#43)
Browse files Browse the repository at this point in the history
* first stab at ploigos docs

* update vars for ploigos

* start rename of tssc to ploigos, reorganize assembly, add user stories for reference

* update workflow to trigger on main branch

* test new organization, fix typos, reogranize abstract info

* general doc updates

* update docs with new info

* fix missing document, update links to official url

* minor typo fix, get rid of shortnames

* minor update to ploigos abstract

* update intro text, test new table width

* update table column

* center the table

* update workflow overview

* minor fixes, add deployment info

* add info for reference deployment

* minor var fixes, typo fix, fix formatting in abstract section

* swap 'master' for 'control', remove optional part of limit ranges step, fix a typo
  • Loading branch information
twling authored Mar 17, 2021
1 parent fe73fc8 commit e76ce9a
Show file tree
Hide file tree
Showing 8 changed files with 456 additions and 352 deletions.
2 changes: 1 addition & 1 deletion docs/assembly-ploigos-contribute.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ifdef::ProjectVersion[:parent-ProjectVersion: {ProjectVersion}]

include::vars/ploigos.adoc[]

[id="{ProjectNameID}"]
[id="{ProjectNameID}-contribute"]
= Contributing
:context: assembly-{ProjectNameID}

Expand Down
2 changes: 1 addition & 1 deletion docs/assembly-ploigos-customize.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ifdef::ProjectVersion[:parent-ProjectVersion: {ProjectVersion}]

include::vars/ploigos.adoc[]

[id="{ProjectNameID}"]
[id="{ProjectNameID}-customize"]
= Customize Workflow
:context: assembly-{ProjectNameID}

Expand Down
2 changes: 1 addition & 1 deletion docs/assembly-ploigos-deploy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ifdef::ProjectVersion[:parent-ProjectVersion: {ProjectVersion}]

include::vars/ploigos.adoc[]

[id="{ProjectNameID}"]
[id="{ProjectNameID}-deploy"]
= Deploy using existing infrastructure
:context: assembly-{ProjectNameID}

Expand Down
4 changes: 1 addition & 3 deletions docs/assembly-ploigos-workflow.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ ifdef::ProjectVersion[:parent-ProjectVersion: {ProjectVersion}]

include::vars/ploigos.adoc[]

[id="{ProjectNameID}"]
[id="{ProjectNameID}-workflow"]
= {ProjectName} - An Opinionated CI/CD Workflow
:context: assembly-{ProjectNameID}

At its core the {ProjectName} defines an opinionated workflow used to deliver software from peoples heads to production. This documentation module defines what that that opinionated workflow is.

include::modules/workflow/con-ploigos-workflow-abstracted.adoc[leveloffset=+1]
include::modules/workflow/ref-ploigos-workflow-tools.adoc[leveloffset=+1]
include::modules/workflow/con-ploigos-workflow-infrastructure.adoc[leveloffset=+1]
Expand Down
8 changes: 3 additions & 5 deletions docs/common/ploigos-terms-definitions.adoc
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
[id="ploigos-terms-definitions-{context}"]
= {ProjectName} Terms and Definitions

{ProjectShortName}:: {ProjectName}
Workflow:: A {ProjectName} procedure as represented by a drawing.

Workflow:: A {ProjectShortName} procedure as represented by a drawing.
Workflow Abstraction:: A {ProjectName} Workflow as represented by a drawing with no specified tooling to implement that steps of the workflow.

Workflow Abstraction:: A {ProjectShortName} Workflow as represented by a drawing with no specified tooling to implement that steps of the workflow.

Workflow Implimentaiton:: An implimentation of a {ProjectShortName} Workflow Abstraction with specific tooling.
Workflow Implementation:: An implementation of a {ProjectName} Workflow Abstraction with specific tooling.
506 changes: 221 additions & 285 deletions docs/modules/workflow/con-ploigos-workflow-abstracted.adoc

Large diffs are not rendered by default.

111 changes: 56 additions & 55 deletions docs/modules/workflow/con-ploigos-workflow-infrastructure.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,61 @@
[id="{ProjectNameID}-workflow-infrastructure", reftext="{ProjectName} Infrastructure Requirements"]
= Infrastructure Requirements

Reference information on the infrastructure used to develop and test the MVP of the <<{ProjectNameID}-workflow-assembly-{ProjectNameID}-workflow>>.
Below is the infrastructure used to develop and test the Minimum Viable Product(MVP) of the Ploigos CI/CD Workflow Reference Implementation. The most basic requirement for the deployment of the Ploigos CI/CD Workflow is an operational OCP 4.x cluster.

.Red Hat OpenShift Sizing
[cols="a,a,a,a,a,a",options="header"]
|===
| Node
| CPUs
| Memory (GB)
| Disk (GB)
| AWS EC2 Instance Type
| Sizing Source

| Control 0
| 8
| 32
| 120
| m4.2xlarge
| https://docs.openshift.com/container-platform/latest/scalability_and_performance/recommended-host-practices.html#master-node-sizing_[OCP 4 Docs - Master Node Sizing]

| Control 1
| 8
| 32
| 120
| m4.2xlarge
| https://docs.openshift.com/container-platform/latest/scalability_and_performance/recommended-host-practices.html#master-node-sizing_[OCP 4 Docs - Master Node Sizing]

| Control 2
| 8
| 32
| 120
| m4.2xlarge
| https://docs.openshift.com/container-platform/latest/scalability_and_performance/recommended-host-practices.html#master-node-sizing_[OCP 4 Docs - Master Node Sizing]

| Compute 0
| 8
| 32
| 120
| m4.2xlarge
| Based on Containerized Tool Sizing needs

| Compute 1
| 8
| 32
| 120
| m4.2xlarge
| Based on Containerized Tool Sizing needs

| Compute 2
| 8
| 32
| 120
| m4.2xlarge
| Based on Containerized Tool Sizing needs
|===


== Suggested Sizing
.Containerized Tool Sizing
Expand Down Expand Up @@ -33,7 +87,7 @@ Reference information on the infrastructure used to develop and test the MVP of
| https://access.redhat.com/documentation/en-us/red_hat_quay/3.2/html/deploy_red_hat_quay_-_basic/preparing_for_red_hat_quay_basic#prerequisites[Quay Docs - Preparing for Red Hat Quay Basic - Prerequisites],
https://access.redhat.com/documentation/en-us/red_hat_quay/3/html/deploy_red_hat_quay_on_openshift_with_quay_setup_operator/architecture[Operator and Quay Architecture]

| Red Hat Quay - Operator Based - DB (Crunchy Data PostgrSQL)
| Red Hat Quay - Operator Based - DB (Crunchy Data PostgreSQL)
| 2 / Operator Governed
| 8 / Operator Governed
|
Expand Down Expand Up @@ -78,56 +132,3 @@ https://access.redhat.com/documentation/en-us/red_hat_quay/3/html/deploy_red_hat
| N/A (embedded in CI container)
|
|===

.Red Hat OpenShift Sizing
[cols="a,a,a,a,a,a",options="header"]
|===
| Node
| CPUs
| Memory (GB)
| Disk (GB)
| AWS EC2 Instance Type
| Sizing Source

| Master 0
| 8
| 32
| 120
| m4.2xlarge
| https://docs.openshift.com/container-platform/4.3/scalability_and_performance/recommended-host-practices.html#master-node-sizing_[OCP 4 Docs - Master Node Sizing]

| Master 1
| 8
| 32
| 120
| m4.2xlarge
| https://docs.openshift.com/container-platform/4.3/scalability_and_performance/recommended-host-practices.html#master-node-sizing_[OCP 4 Docs - Master Node Sizing]

| Master 2
| 8
| 32
| 120
| m4.2xlarge
| https://docs.openshift.com/container-platform/4.3/scalability_and_performance/recommended-host-practices.html#master-node-sizing_[OCP 4 Docs - Master Node Sizing]

| Compute 0
| 8
| 32
| 120
| m4.2xlarge
| Based on Containerized Tool Sizing needs

| Compute 1
| 8
| 32
| 120
| m4.2xlarge
| Based on Containerized Tool Sizing needs

| Compute 2
| 8
| 32
| 120
| m4.2xlarge
| Based on Containerized Tool Sizing needs
|===
173 changes: 172 additions & 1 deletion docs/modules/workflow/proc-ploigos-workflow-reference-impl.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,175 @@

= Reference Implementation

TODO
The following guide shows how to deploy the reference implementation of the Ploigos Standard Workflow into an OCP 4.x cluster with a simple quarkus application as a demo.


== Prerequisites

* Operational OCP 4.x cluster


== Installing the Ploigos Software Factory Operator

See https://github.com/ploigos/ploigos-software-factory-operator[ploigos-software-factory-operator] for latest information.


. Login to an OCP cluster as `cluster-admin`
. Import the RedHatGov Operator Catalog (Create a custom `CatalogSource`)
+
----
oc apply -f - << EOF
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: redhatgov-operators
namespace: openshift-marketplace
spec:
sourceType: grpc
image: quay.io/redhatgov/operator-catalog:latest
displayName: Red Hat NAPS Community Operators
publisher: RedHatGov
EOF
----
+
. Create a project named *devsecops* for the pipeline tooling+
+
----
oc new-project devsecops
----
+
. Remove restrictive limit ranges *NOTE: Required for RHPDS clusters*
+
----
oc delete limitrange --all -n devsecops
----
+
. Install the 'Ploigos Software Factory Operator'
* In the OCP Web Console, navigate to:
** *Operators -> OperatorHub*
** Search for "Ploigos Software Factory Operator"
** Select Operator and click *Install*

== Deploy the Ploigos Platform and Pipeline

. In the OCP WebUI, Select the *devsecops* namespace
. Deploy the Ploigos Platform
* Navigate to *Installed Operators -> Ploigos Software Factory*
* Inside the software factory operator screen, click *[+ TSSCPlatform]*
* Wait for the deployment to finish
** Navigate to the _tssc-operator-controller-manager_ pod and watch the logs for the "PLAY RECAP " line
. Deploy the Ploigos Pipeline
* Navigate to *Installed Operators -> Ploigos Software Factory*
* Inside the software factory operator screen, click *[+ TSSCPipeline]*
. Access the deployed Jenkins pod to watch progress
* Navigate to *Routes -> Jenkins* and click the Jenkins Route
* Login to Jenkins with Openshift Credentials
* Navigate to *platform -> reference-quarkus-mvn_jekins_workflow-standard -> main*
* Click "Open Blue Ocean" (Vertical menu on left side)
* Watch the pipeline progress and wait for 100%

== Add SSH Key to Gitea

. Obtain the Gitea credentials
* In the *devsecops* namespace, navigate to *Secrets*
* From the secret *tssc-service-account*, copy the username and password
* Navigate to *Routes* and open the Gitea route
. Login to Gitea with the tssc-service-account username/password
. Add SSH Key to account in Gitea
* Click the Profile Icon (top left corner)
* Select Settings
* Select 'Add Key'
* Enter a public key
* Click 'Add Key'

== Setup the Development Environment with reference application
The following directions are designed to setup a development environment for Ploigos. By creating forks of the official repositories, a developer can customize the workflow as needed.

. Fork required Ploigos repositories
* Create a fork of: https://github.com/ploigos/ploigos-step-runner
* Create a fork of: https://github.com/ploigos/ploigos-jenkins-library
* Clone repositories above to local machine
. Configure the Jenkinsfile to point to the *ploigos-step-runner* fork
* In Gitea, navigate to the quarkus reference application Jenkinsfile `cicd/Jenkinsfile`
* Add the following to the end of the Jenkinsfile:

stepRunnerUpdateLibrary: true,
stepRunnerLibSourceUrl: "git+​ https://github.com/[your-step-runner-fork]@[the-branch-to-use​ ]"

** Replace [your-step-runner-fork] with your fork URL
** Replace [the-branch-to-use] with target branch
* Commit Changes
* Initiate Pull Request
* Upon successful Pull Request build, Merge changes into main branch of the reference-quarkus-mvn-jenkins repository
. Configure the Jenkinsfile to point to the *ploigos-jenkins-library* fork
* In Gitea, navigate to the quarkus reference application Jenkinsfile `cicd/Jenkinsfile`
* Replace the *remote:* line of the Jenkinsfile with the forked jenkins library URL

// Load the TSSC Jenkins Library
library identifier: 'ploigos-jenkins-library@main',
retriever: modernSCM([
$class: 'GitSCMSource',
remote: 'https://github.com/<username>/ploigos-jenkins-library.git'
])

** NOTE: also update the *library identifier:* line with the branch name if it differs from `main`
* Commit Changes
* Initiate Pull Request
* Upon successful Pull Request build, Merge changes into main branch of the reference-quarkus-mvn-jenkins repository

== Changing from the Ploigos CI/CD Standard Workflow to the Ploigos CI/CD Minimum Workflow

. In Gitea, navigate to the quarkus reference application Jenkinsfile `cicd/Jenkinsfile`:

// Load the Ploigos Jenkins Library
library identifier: '[email protected]',
retriever: modernSCM([
$class: 'GitSCMSource',
remote: 'https://github.com/ploigos/ploigos-jenkins-library.git'
])

// run the pipeline
ploigosWorkflowStandard(
stepRunnerConfigDir: 'cicd/ploigos-step-runner-config/',
pgpKeysSecretName: 'pgp-keys-ploigos-workflow-ref-quarkus-mvn-jenkins-std-fruit',

workflowServiceAccountName: 'ploigos-workflow-ref-quarkus-mvn-jenkins-std-fruit',

workflowWorkerImageDefault: 'ploigos/ploigos-ci-agent-jenkins:v0.16.0',
workflowWorkerImageUnitTest: 'ploigos/ploigos-tool-maven:v0.16.0',
workflowWorkerImagePackage: 'ploigos/ploigos-tool-maven:v0.16.0',
workflowWorkerImageStaticCodeAnalysis: 'ploigos/ploigos-tool-sonar:v0.16.0',
workflowWorkerImagePushArtifacts: 'ploigos/ploigos-tool-maven:v0.16.0',
workflowWorkerImageContainerOperations: 'ploigos/ploigos-tool-containers:v0.16.0',
workflowWorkerImageContainerImageStaticComplianceScan: 'ploigos/ploigos-tool-openscap:v0.16.0',
workflowWorkerImageContainerImageStaticVulnerabilityScan: 'ploigos/ploigos-tool-openscap:v0.16.0',
workflowWorkerImageDeploy: 'ploigos/ploigos-tool-argocd:v0.16.0',
workflowWorkerImageValidateEnvironmentConfiguration: 'ploigos/ploigos-tool-config-lint:v0.16.0',
workflowWorkerImageUAT: 'ploigos/ploigos-tool-maven:v0.16.0'
)

. Rename the function `ploigosWorkflowStandard` to `ploigosWorkflowMinimal` and Remove *workflowWorker* Lines to conform to the Ploigos Minimal Workflow:

// Load the Ploigos Jenkins Library
library identifier: '[email protected]',
retriever: modernSCM([
$class: 'GitSCMSource',
remote: 'https://github.com/ploigos/ploigos-jenkins-library.git'
])

// run the pipeline
ploigosWorkflowMinimal(
stepRunnerConfigDir: 'cicd/ploigos-step-runner-config/',
pgpKeysSecretName: 'pgp-keys-ploigos-workflow-ref-quarkus-mvn-jenkins-std-fruit',

workflowServiceAccountName: 'ploigos-workflow-ref-quarkus-mvn-jenkins-std-fruit',
workflowWorkerImageDefault: 'ploigos/ploigos-ci-agent-jenkins:v0.16.0',
workflowWorkerImagePackage: 'ploigos/ploigos-tool-maven:v0.16.0',
workflowWorkerImagePushArtifacts: 'ploigos/ploigos-tool-maven:v0.16.0',
workflowWorkerImageContainerOperations: 'ploigos/ploigos-tool-containers:v0.16.0',
workflowWorkerImageDeploy: 'ploigos/ploigos-tool-argocd:v0.16.0',
)

. Commit Changes
. Initiate Pull Request
. Upon successful Pull Request build, Merge changes into main branch of the reference-quarkus-mvn-jenkins repository

0 comments on commit e76ce9a

Please sign in to comment.