Skip to content

Commit 9f8ae6d

Browse files
committed
Merge branch 'main' into develop-v2
2 parents e2e6210 + 38100af commit 9f8ae6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+804
-379
lines changed

.github/workflows/publish-github-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021, 2023, Oracle and/or its affiliates.
1+
# Copyright (c) 2021, 2024, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
#
44
# Description
@@ -36,7 +36,7 @@ jobs:
3636
with:
3737
ref: gh-pages
3838
path: gh-pages
39-
token: ${{ secrets.PUBLISH_SECRET }}
39+
token: ${{ secrets.GITHUB_TOKEN }}
4040

4141
- name: Build and publish site
4242
run: |
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: "Configuration"
3+
date: 2024-04-16T08:00:00-05:00
4+
draft: false
5+
weight: 5
6+
---
7+
8+
The default configuration is typically adequate for common use. But, the following environment variables are provided for
9+
non-typical use cases when the default values are insufficient.
10+
11+
### Environment variables
12+
13+
- `WLSIMG_BLDDIR` - During the build process, Image Tool creates a Docker context directory where it will create a Dockerfile and copy necessary files for the container image build. Setting this variable to another directory overrides the default of the user's home directory as the parent folder of the Docker context directory.
14+
- `WLSIMG_BUILDER` - As an alternative to the command-line argument `--builder`, this variable can be used to override the tool to process the Dockerfile (such as`docker` or `podman`). The provided value should be the full path to the executable. For example, `WLSIMG_BUILDER="/usr/bin/docker"`.
15+
- `WLSIMG_CACHEDIR` - When Image Tool downloads patches, those patches are saved in the cache directory. Setting this variable to another directory overrides the default of the `cache` folder in the user's home directory.
16+
- `WLSIMG_OS_PACKAGES` - There are several packages and libraries that are required by the WebLogic Kubernetes Toolkit. The default packages included at build time are `gzip tar unzip libaio libnsl jq findutils diffutils`. The names for those libraries can be different depending on your preferred Linux distribution or OS version. The value that you provide in this environment variable will be used in place of the default package list.
17+
18+

imagetool/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<parent>
1414
<artifactId>imagetool-parent</artifactId>
1515
<groupId>com.oracle.weblogic.lifecycle.imagetool</groupId>
16-
<version>1.13.2-SNAPSHOT</version>
16+
<version>1.14.0-SNAPSHOT</version>
1717
<relativePath>../pom.xml</relativePath>
1818
</parent>
1919

imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/AruProduct.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
public enum AruProduct {
1212
WLS("15991", "Oracle WebLogic Server"),
1313
COH("13964", "Oracle Coherence"),
14-
JRF("10120", "Oracle Java Required Files"),
14+
JRF("10120", "Oracle Fusion Middleware"),
1515
FMWPLAT("27638", "FMW Platform"),
1616
OSB("16011", "Oracle Service Bus"),
1717
SOA("12745", "Oracle SOA Suite"),

imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/AruUtil.java

Lines changed: 78 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,19 @@ List<AruPatch> getLatestPsu(AruProduct product, String version, String userId, S
137137
try {
138138
logger.info("IMG-0019", product.description());
139139
String releaseNumber = getReleaseNumber(product, version, userId, password);
140+
if (Utils.isEmptyString(releaseNumber)) {
141+
// ARU does not have a release number for the given product and version, return empty patch list
142+
logger.info(Utils.getMessage("IMG-0082", version, product.description()));
143+
return Collections.emptyList();
144+
}
140145
Document aruRecommendations = retry(
141146
() -> getRecommendedPatchesMetadata(product, releaseNumber, userId, password));
142147
logger.exiting();
143148
return AruPatch.getPatches(aruRecommendations)
144149
.filter(AruPatch::isPsu)
145150
.filter(not(AruPatch::isStackPatchBundle))
146151
.collect(Collectors.toList());
147-
} catch (NoPatchesFoundException | ReleaseNotFoundException ex) {
152+
} catch (NoPatchesFoundException ex) {
148153
logger.exiting();
149154
return Collections.emptyList();
150155
} catch (RetryFailedException | XPathExpressionException e) {
@@ -154,7 +159,7 @@ List<AruPatch> getLatestPsu(AruProduct product, String version, String userId, S
154159
}
155160

156161
/**
157-
* Get list of recommended patches available for a given product and version.
162+
* Get list of recommended patches available for all the products that are part of the FMW installer type.
158163
*
159164
* @param type FMW installer type
160165
* @param version version number like 12.2.1.3.0
@@ -165,20 +170,8 @@ public List<AruPatch> getRecommendedPatches(FmwInstallerType type, String versio
165170
String userId, String password) throws AruException {
166171
List<AruPatch> result = new ArrayList<>();
167172
for (AruProduct product : type.products()) {
168-
List<AruPatch> patches = getRecommendedPatches(product, version, userId, password);
169-
// temporary, until OHS stops using same release number and product ID for two different installs
170-
if (type == FmwInstallerType.OHS_DB19) {
171-
if (product == AruProduct.OHS) {
172-
patches = patches.stream().filter(p -> p.description().contains(" DB19C "))
173-
.collect(Collectors.toList());
174-
} else if (product == AruProduct.OAM_WG) {
175-
patches = patches.stream().filter(p -> p.description().contains(" DB19c "))
176-
.collect(Collectors.toList());
177-
} else if (product == AruProduct.OSS) {
178-
patches = patches.stream().filter(p -> p.description().contains(" 19C "))
179-
.collect(Collectors.toList());
180-
}
181-
}
173+
List<AruPatch> patches = getRecommendedPatches(type, product, version, userId, password);
174+
182175
if (!patches.isEmpty()) {
183176
patches.forEach(p -> logger.info("IMG-0068", product.description(), p.patchId(), p.description()));
184177
result.addAll(patches);
@@ -200,47 +193,71 @@ public List<AruPatch> getRecommendedPatches(FmwInstallerType type, String versio
200193
* @return the recommended patches for the given product and version
201194
* @throws AruException when response from ARU has an error or fails
202195
*/
203-
List<AruPatch> getRecommendedPatches(AruProduct product, String version, String userId, String password)
204-
throws AruException {
196+
List<AruPatch> getRecommendedPatches(FmwInstallerType type, AruProduct product, String version,
197+
String userId, String password) throws AruException {
205198
logger.entering(product, version);
199+
List<AruPatch> patches = Collections.emptyList();
206200
try {
207201
logger.info("IMG-0067", product.description());
208202
String releaseNumber = getReleaseNumber(product, version, userId, password);
209-
Document aruRecommendations = retry(
210-
() -> getRecommendedPatchesMetadata(product, releaseNumber, userId, password));
211-
// TODO: Need an option for the user to request the Coherence additional feature pack.
212-
List<AruPatch> patches = AruPatch.getPatches(aruRecommendations)
213-
.filter(not(AruPatch::isStackPatchBundle)) //remove Stack Patch Bundle
214-
.filter(not(AruPatch::isCoherenceFeaturePack)) //remove COH feature pack
215-
.collect(Collectors.toList());
216-
String psuVersion = getPsuVersion(product.description(), patches);
217-
if (psuVersion != null) {
218-
//repeat the same process to get recommended patches, but use the PSU release instead of the GA release
219-
// All the same patches are in the PSU release, but also the overlay patches (if any)
220-
patches.forEach(p -> logger.fine("Discarding recommended patch {0} {1}", p.patchId(), p.description()));
221-
logger.fine("Recommended patch list contains a PSU, getting recommendations for PSU version {0}",
222-
psuVersion);
223-
// get release number for PSU
224-
String psuReleaseNumber = getReleaseNumber(product, psuVersion, userId, password);
225-
// get recommended patches for PSU release (Overlay patches are only recommended on the PSU release)
226-
Document psuOverrides = retry(
227-
() -> getRecommendedPatchesMetadata(product, psuReleaseNumber, userId, password));
228-
229-
patches = AruPatch.getPatches(psuOverrides)
230-
.filter(not(AruPatch::isStackPatchBundle)) // remove the Stack Patch Bundle patch, if returned
231-
.filter(not(AruPatch::isCoherenceFeaturePack)) // remove the Coherence feature pack, if returned
232-
.collect(Collectors.toList());
203+
if (Utils.isEmptyString(releaseNumber)) {
204+
// ARU does not have a release number for the given product and version, return an empty patch list
205+
logger.info(Utils.getMessage("IMG-0082", version, product.description()));
206+
} else {
207+
// Get a list of patches applicable to the given product and release number
208+
patches = getReleaseRecommendations(product, releaseNumber, userId, password);
209+
logger.fine("Search for {0} recommended patches returned {1}", product, patches.size());
210+
if (type == FmwInstallerType.OHS_DB19) {
211+
// Workaround for OHS where the DB19 patches and the DB12 patches have the same product/release ID
212+
patches = filterDb19Patches(patches, product);
213+
}
214+
215+
String psuVersion = getPsuVersion(product.description(), patches);
216+
if (psuVersion != null) {
217+
// Check to see if there is a release with the PSU version that contains overlay patches.
218+
logger.fine("Recommended patch list contains a PSU, getting recommendations for PSU version {0}",
219+
psuVersion);
220+
// Get the release number for the PSU version number
221+
String psuReleaseNumber = getReleaseNumber(product, psuVersion, userId, password);
222+
// If there is a release for the specific PSU, check it for overlay patches
223+
if (!Utils.isEmptyString(psuReleaseNumber)) {
224+
// Get recommended patches for PSU release (includes PSU overlay patches)
225+
List<AruPatch> overlays =
226+
getReleaseRecommendations(product, psuReleaseNumber, userId, password);
227+
logger.fine("Search for PSU {0} overlay patches returned {1}", psuVersion, overlays.size());
228+
patches.addAll(overlays);
229+
} else {
230+
// ARU does not have a release number for the PSU version found (no overlays needed)
231+
logger.fine("PSU release was not found for {0} : {1}", product, psuVersion);
232+
}
233+
}
233234
}
234-
logger.exiting(patches);
235-
return patches;
236-
} catch (ReleaseNotFoundException nf) {
237-
return Collections.emptyList();
238235
} catch (NoPatchesFoundException npf) {
239236
logger.info("IMG-0069", product.description(), version);
240-
return Collections.emptyList();
241237
} catch (RetryFailedException | XPathExpressionException e) {
242238
throw new AruException(Utils.getMessage("IMG-0070", product.description(), version), e);
243239
}
240+
logger.exiting(patches);
241+
return patches;
242+
}
243+
244+
/**
245+
* This is a temporary workaround to select DB19 patches from a recommended list of patches.
246+
* Currently, OHS is using the same release number and product ID for two different installs (DB19 and DB12).
247+
* @param patches patches list to filter
248+
* @param product AruProduct that the supplied patches are for
249+
*/
250+
private List<AruPatch> filterDb19Patches(List<AruPatch> patches, AruProduct product) {
251+
List<AruPatch> result = patches;
252+
// temporary, until OHS stops using same release number and product ID for two different installs
253+
if (product == AruProduct.OHS) {
254+
result = patches.stream().filter(p -> p.description().contains(" DB19C ")).collect(Collectors.toList());
255+
} else if (product == AruProduct.OAM_WG) {
256+
result = patches.stream().filter(p -> p.description().contains(" DB19c ")).collect(Collectors.toList());
257+
} else if (product == AruProduct.OSS) {
258+
result = patches.stream().filter(p -> p.description().contains(" 19C ")).collect(Collectors.toList());
259+
}
260+
return result;
244261
}
245262

246263
private String getPsuVersion(String productName, Collection<AruPatch> patches) {
@@ -256,6 +273,20 @@ private String getPsuVersion(String productName, Collection<AruPatch> patches) {
256273
return null;
257274
}
258275

276+
List<AruPatch> getReleaseRecommendations(AruProduct product, String releaseNumber, String userId, String password)
277+
throws AruException, XPathExpressionException, RetryFailedException {
278+
279+
Document patchesDocument = retry(
280+
() -> getRecommendedPatchesMetadata(product, releaseNumber, userId, password));
281+
282+
return AruPatch.getPatches(patchesDocument)
283+
.filter(not(AruPatch::isStackPatchBundle)) // remove the Stack Patch Bundle patch, if returned
284+
// TODO: Need an option for the user to request the Coherence additional feature pack.
285+
.filter(not(AruPatch::isCoherenceFeaturePack)) // remove the Coherence feature pack, if returned
286+
.filter(p -> p.release().equals(releaseNumber))
287+
.collect(Collectors.toList());
288+
}
289+
259290
static class PatchLists {
260291
List<InstalledPatch> installedPatches;
261292
List<AruPatch> candidatePatches;
@@ -358,7 +389,6 @@ Document getRecommendedPatchesMetadata(AruProduct product, String releaseNumber,
358389
* @param password OTN credential password
359390
* @return release number for the product and version provided
360391
* @throws AruException if the call to ARU fails, or the response from ARU had an error
361-
* @throws ReleaseNotFoundException if the specified version for the requested product was not found
362392
*/
363393
private String getReleaseNumber(AruProduct product, String version, String userId, String password)
364394
throws AruException {
@@ -375,11 +405,6 @@ private String getReleaseNumber(AruProduct product, String version, String userI
375405
} catch (XPathExpressionException xpe) {
376406
throw new AruException("Could not extract release number with XPath", xpe);
377407
}
378-
if (Utils.isEmptyString(result)) {
379-
String msg = Utils.getMessage("IMG-0082", version, product.description());
380-
logger.info(msg);
381-
throw new ReleaseNotFoundException(msg);
382-
}
383408
logger.exiting(result);
384409
return result;
385410
}

imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/ReleaseNotFoundException.java

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)