Skip to content

Commit 13fdc68

Browse files
committed
Add using images Jenkins and PR14030 follow-up
1 parent 78dc462 commit 13fdc68

37 files changed

+1095
-44
lines changed

_topic_map.yml

+10
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,16 @@ Topics:
406406
File: using-templates
407407
- Name: Using Ruby on Rails
408408
File: templates-using-ruby-on-rails
409+
- Name: Using images
410+
Dir: using_images
411+
Distros: openshift-enterprise,openshift-origin
412+
Topics:
413+
- Name: Using images overview
414+
File: using-images-overview
415+
- Name: Configuring Jenkins images
416+
File: images-other-jenkins
417+
- Name: Jenkins agent
418+
File: images-other-jenkins-agent
409419
---
410420
Name: Applications
411421
Dir: applications

modules/builds-build-custom-builder-image.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ $ oc new-build --binary --strategy=docker --name custom-builder-image
2828
$ oc start-build custom-builder-image --from-dir . -F
2929
----
3030
+
31-
After the build completes, your new custom builder image will be
32-
available in your project in an imagestream tag named
31+
After the build completes, your new custom builder image is
32+
available in your project in an imagestreamtag that is named
3333
`custom-builder-image:latest`.

modules/builds-image-source.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
You can add additional files to the build process with images. Input images are
1313
referenced in the same way the `From` and `To` image targets are defined. This
14-
means both container images and imagestream tags can be referenced. In
14+
means both container images and imagestreamtags can be referenced. In
1515
conjunction with the image, you must provide one or more path pairs to indicate
1616
the path of the files or directories to copy the image and the destination to
1717
place them in the build context.
@@ -67,6 +67,6 @@ endif::[]
6767
6868
* Custom Strategy
6969
ifndef::openshift-online[]
70-
* ImageStream Tags
70+
* ImageStreamTags
7171
endif::[]
7272
/////

modules/builds-using-image-change-triggers.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ latest RHEL base image.
1515
====
1616
Imagestreams that point to container images in
1717
link:http://docs.docker.com/v1.7/reference/api/hub_registry_spec/#docker-registry-1-0[v1
18-
container registries] only trigger a build once when the imagestream tag
18+
container registries] only trigger a build once when the imagestreamtag
1919
becomes available and not on subsequent image updates. This is due to the lack
2020
of uniquely identifiable images in v1 container registries.
2121
====

modules/deployments-triggers.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ triggers:
4141
=== ImageChange deployment triggers
4242

4343
The `ImageChange` trigger results in a new ReplicationController whenever the
44-
content of an imagestream tag changes (when a new version of the image is
44+
content of an imagestreamtag changes (when a new version of the image is
4545
pushed).
4646

4747
.ImageChange deployment trigger

modules/images-getting-info-about-imagestreams.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Tags: 1
3838
About a minute ago
3939
----
4040

41-
* Get all the information available about particular imagestream tag:
41+
* Get all the information available about particular imagestreamtag:
4242
+
4343
----
4444
$ oc describe istag/<image-stream>:<tag-name>

modules/images-imagestream-configure.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ status:
4646

4747
<1> The name of the imagestream.
4848
<2> Docker repository path where new images can be pushed to add/update them in this imagestream.
49-
<3> The SHA identifier that this imagestream tag currently references. Resources that reference this imagestream tag use this identifier.
50-
<4> The SHA identifier that this imagestream tag previously referenced. Can be used to rollback to an older image.
51-
<5> The imagestream tag name.
49+
<3> The SHA identifier that this imagestreamtag currently references. Resources that reference this imagestreamtag use this identifier.
50+
<4> The SHA identifier that this imagestreamtag previously referenced. Can be used to rollback to an older image.
51+
<5> The imagestreamtag name.

modules/images-imagestream-import.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// * assembly/openshift_images
33

44
[id="images-imagestreams-import_{context}"]
5-
= Configuring periodic importing of imagestream tags
5+
= Configuring periodic importing of imagestreamtags
66

77
When working with an external container image registry, to periodically
88
re-import an image, for example to get latest security updates, you can use the

modules/images-imagestream-remove-tag.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// * assembly/openshift_images
33

44
[id="images-imagestreams-remove-tag_{context}"]
5-
= Removing imagestream tags
5+
= Removing imagestreamtags
66

77
You can remove old tags from an imagestream.
88

modules/images-imagestream-tag.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// * assembly/openshift_images
33

44
[id="images-imagestream-tag_{context}"]
5-
== Imagestream tags
5+
== Imagestreamtags
66

7-
An imagestream tag is a named pointer to an image in an imagestream. An image
7+
An imagestreamtag is a named pointer to an image in an imagestream. An image
88
stream tag is similar to a container image tag.

modules/images-imagestream-trigger.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[id="image-stream-trigger_{context}"]
55
= Imagestream triggers
66

7-
An imagestream trigger causes a specific action when an imagestream tag
7+
An imagestream trigger causes a specific action when an imagestreamtag
88
changes. For example, importing can cause the value of the tag to change, which
99
causes a trigger to fire when there are Deployments, Builds, or other resources
1010
listening for those.

modules/images-imagestream-update-tag.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// * assembly/openshift_images
33

44
[id="images-imagestreams-update-tag_{context}"]
5-
= Updating imagestream tags
5+
= Updating imagestreamtags
66

77
You can update a tag to reflect another tag in an imagestream.
88

modules/images-imagestream-use.adoc

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ For example, if a Deployment is using a certain image and a new version of that
2020
image is created, a Deployment could be automatically performed to pick up the
2121
new version of the image.
2222

23-
However, if the imagestream tag used by the Deployment or Build is not updated,
23+
However, if the imagestreamtag used by the Deployment or Build is not updated,
2424
then even if the container image in the container image registry is updated, the
2525
Build or Deployment will continue using the previous, presumably known good
2626
image.
@@ -31,10 +31,10 @@ The source images can be stored in any of the following:
3131
* An external registry, for example `registry.redhat.io` or `hub.docker.com`.
3232
* Other imagestreams in the {product-title} cluster.
3333

34-
When you define an object that references an imagestream tag (such as a Build
35-
or Deployment configuration), you point to an imagestream tag, not the Docker
34+
When you define an object that references an imagestreamtag (such as a Build
35+
or Deployment configuration), you point to an imagestreamtag, not the Docker
3636
repository. When you Build or Deploy your application, {product-title} queries
37-
the Docker repository using the imagestream tag to locate the associated ID of
37+
the Docker repository using the imagestreamtag to locate the associated ID of
3838
the image and uses that exact image.
3939

4040
The imagestream metadata is stored in the etcd instance along with other
@@ -56,7 +56,7 @@ and/or Deployment flow, depending upon the Build or Deployment configuration.
5656
* You can share images using fine-grained access control and quickly distribute
5757
images across your teams.
5858

59-
* If the source image changes, the imagestream tag will still point to a
59+
* If the source image changes, the imagestreamtag will still point to a
6060
known-good version of the image, ensuring that your application will not break
6161
unexpectedly.
6262

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * images/using_images/images-other-jenkins-agent.adoc
4+
5+
[id="images-other-jenkins-agent-env-var_{context}"]
6+
= Jenkins agent environment variables
7+
8+
Each Jenkins agent container can be configured with the following environment
9+
variables.
10+
11+
[options="header"]
12+
|===
13+
| Variable | Definition | Example values and settings
14+
15+
|`JAVA_MAX_HEAP_PARAM`,
16+
`CONTAINER_HEAP_PERCENT`,
17+
`JENKINS_MAX_HEAP_UPPER_BOUND_MB`
18+
|These values control the maximum heap size of the Jenkins JVM. If
19+
`JAVA_MAX_HEAP_PARAM` is set, its value takes
20+
precedence. Otherwise, the maximum heap size is dynamically calculated as
21+
`CONTAINER_HEAP_PERCENT` of the container
22+
memory limit, optionally capped at `JENKINS_MAX_HEAP_UPPER_BOUND_MB` MiB.
23+
24+
By default, the maximum heap size of the Jenkins JVM is set to 50% of the
25+
container memory limit with no cap.
26+
|`JAVA_MAX_HEAP_PARAM` example setting: `-Xmx512m`
27+
28+
`CONTAINER_HEAP_PERCENT` default: `0.5`, or 50%
29+
30+
`JENKINS_MAX_HEAP_UPPER_BOUND_MB` example setting: `512 MiB`
31+
32+
|`JAVA_INITIAL_HEAP_PARAM`,
33+
`CONTAINER_INITIAL_PERCENT`
34+
|These values control the initial heap size of the Jenkins JVM. If
35+
`JAVA_INITIAL_HEAP_PARAM` is set, its value takes
36+
precedence. Otherwise, the initial heap size is dynamically calculated as
37+
`CONTAINER_INITIAL_PERCENT` of the
38+
dynamically calculated maximum heap size.
39+
40+
By default, the JVM sets the initial heap size.
41+
|`JAVA_INITIAL_HEAP_PARAM` example setting: `-Xms32m`
42+
43+
`CONTAINER_INITIAL_PERCENT` example setting: `0.1`, or 10%
44+
45+
|`CONTAINER_CORE_LIMIT`
46+
|If set, specifies an integer number of cores used for sizing numbers of internal
47+
JVM threads.
48+
|Example setting: `2`
49+
50+
|`JAVA_TOOL_OPTIONS`
51+
|Specifies options to apply to all JVMs running in this container. It is not
52+
recommended to override this value.
53+
|Default: `-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Dsun.zip.disableMemoryMapping=true`
54+
55+
|`JAVA_GC_OPTS`
56+
|Specifies Jenkins JVM garbage collection parameters. It is not recommended to
57+
override this value.
58+
|Default: `-XX:+UseParallelGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90`
59+
60+
|`JENKINS_JAVA_OVERRIDES`
61+
|Specifies additional options for the Jenkins JVM. These options are appended to
62+
all other options, including the Java options above, and can be used to override
63+
any of them, if necessary. Separate each additional option with a space; if any
64+
option contains space characters, escape them with a backslash.
65+
|Example settings: `-Dfoo -Dbar`; `-Dfoo=first\ value -Dbar=second\ value`
66+
67+
|===
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * images/using_images/images-other-jenkins-agent.adoc
4+
5+
[id="images-other-jenkins-agent-gradle_{context}"]
6+
= Jenkins agent Gradle builds
7+
8+
Hosting Gradle builds in the Jenkins agent on {product-title} presents
9+
additional complications because in addition to the Jenkins JNLP agent and
10+
Gradle JVMs, Gradle spawns a third JVM to run tests if they are specified.
11+
12+
13+
The following settings are suggested as a starting point for running Gradle
14+
builds in a memory constrained Jenkins agent on {product-title}. You can modify
15+
these settings as required.
16+
17+
* Ensure the long-lived Gradle daemon is disabled by adding
18+
`org.gradle.daemon=false` to the `gradle.properties` file.
19+
* Disable parallel build execution by ensuring `org.gradle.parallel=true` is not
20+
set in the `gradle.properties` file and that `--parallel` is not set as a command
21+
line argument.
22+
* To prevent Java compilations running out-of-process, set `java { options.fork =
23+
false }` in the `build.gradle` file .
24+
* Disable multiple additional test processes by ensuring
25+
`test { maxParallelForks = 1 }` is set in the `build.gradle` file.
26+
* Override the Gradle JVM memory parameters by the `GRADLE_OPTS`, `JAVA_OPTS` or
27+
`JAVA_TOOL_OPTIONS` environment.
28+
variables.
29+
* Set the maximum heap size and JVM arguments for any Gradle test JVM by defining
30+
the `maxHeapSize` and `jvmArgs` settings in `build.gradle`, or though the
31+
`-Dorg.gradle.jvmargs` command line argument.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * images/using_images/images-other-jenkins-agent.adoc
4+
5+
[id="images-other-jenkins-agent-images_{context}"]
6+
= Jenkins agent images
7+
8+
The {product-title} Jenkins agent images are available on `quay.io` or
9+
`registry.redhat.io`.
10+
11+
Jenkins images are available through the Red Hat Registry:
12+
13+
----
14+
$ docker pull regsitry.redhat.io/openshift4/ose-jenkins:<v4.1.4>
15+
$ docker pull regsitry.redhat.io/openshift4/ose-jenkins-agent-nodejs:<v4.1.4>
16+
$ docker pull regsitry.redhat.io/openshift4/ose-jenkins-agent-maven:<v4.1.4>
17+
$ docker pull regsitry.redhat.io/openshift4/ose-jenkins-agent-base:<v4.1.4>
18+
----
19+
20+
To use these images, you can either access them directly from `quay.io` or
21+
`registry.redhat.io` or push them into your {product-title} container image
22+
registry.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * images/using_images/images-other-jenkins-agent.adoc
4+
5+
[id="images-other-jenkins-agent-memory_{context}"]
6+
= Jenkins agent memory requirements
7+
8+
A JVM is used in all Jenkins agents to host the Jenkins JNLP agent as well as
9+
to run any Java applications such as `javac`, Maven, or Gradle.
10+
11+
For memory efficiency, the Jenkins image dynamically uses a 32-bit
12+
JVM if it runs in a container with a memory limit under 2 GiB by default. The
13+
JVM choice applies by default both for the Jenkins JNLP agent as well as for any
14+
other Java processes within the agent container.
15+
16+
By default, the Jenkins JNLP agent JVM uses 50% of the container memory limit for
17+
its heap. This value can be modified by the `CONTAINER_HEAP_PERCENT`
18+
environment variable. It can also be capped at an upper limit or overridden
19+
entirely.
20+
21+
By default any other processes run in the Jenkins agent container, such as
22+
shell scripts or `oc` commands run from pipelines, cannot use more
23+
than the remaining 50% memory limit without provoking an OOM kill.
24+
25+
By default, each further JVM process that runs in a Jenkins agent container uses
26+
up to 25% of the container memory limit for it's heap. It might be necessary to
27+
tune this limit for many build workloads.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * images/using_images/images-other-jenkins-agent.adoc
4+
5+
[id="images-other-jenkins-agent-pod-retention_{context}"]
6+
= Jenkins agent pod retention
7+
8+
Jenkins agent pods, also known as slave pods, are deleted by default after the
9+
build completes or is stopped. This behavior can be changed by the Kubernetes
10+
plug-in _Pod Retention_ setting. Pod retention can be set for all Jenkins
11+
builds, with overrides for each pod template. The following behaviors are
12+
supported:
13+
14+
* `Always` keeps the build pod regardless of build result.
15+
* `Default` uses the plug-in value (pod template only).
16+
* `Never` always deletes the pod.
17+
* `On Failure` keeps the pod if it fails during the build.
18+
19+
You can override pod retention in the pipeline Jenkinsfile:
20+
21+
[source,groovy]
22+
----
23+
podTemplate(label: "mypod",
24+
cloud: "openshift",
25+
inheritFrom: "maven",
26+
podRetention: onFailure(), <1>
27+
containers: [
28+
...
29+
]) {
30+
node("mypod") {
31+
...
32+
}
33+
}
34+
----
35+
<1> Allowed values for `podRetention` are `never()`, `onFailure()`, `always()`,
36+
and `default()`.
37+
38+
[WARNING]
39+
====
40+
Pods that are kept might continue to run and count against resource quotas.
41+
====
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * images/using_images/images-other-jenkins.adoc
4+
5+
[id="images-other-jenkins-auth_{context}"]
6+
= Jenkins authentication
7+
8+
Jenkins authentication is used by default if the image is run directly, without
9+
using a template.
10+
11+
The first time Jenkins starts, the configuration is created along with the
12+
administrator user and password. The default user credentials are `admin` and
13+
`password`. Configure the default password by setting the `JENKINS_PASSWORD`
14+
environment variable when using, and only when using, standard Jenkins
15+
authentication.
16+
17+
.Procedure
18+
19+
* Create a Jenkins application that uses standard Jenkins authentication:
20+
+
21+
----
22+
$ oc new-app -e \
23+
JENKINS_PASSWORD=<password> \
24+
openshift4/ose-jenkins
25+
----

0 commit comments

Comments
 (0)