Skip to content

Commit

Permalink
Zowe Suite v1.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zowe-robot authored Oct 13, 2021
2 parents 630844f + e53b651 commit b71b202
Show file tree
Hide file tree
Showing 8 changed files with 241 additions and 51 deletions.
134 changes: 128 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ name: app-server build
on:
push:
branches: [ master ]
workflow_dispatch:
inputs:
release:
description: 'Whether this is a test build or official release'
required: true
default: false

env:
IMAGE_BASE_DIR: container
RELEASE: true

jobs:
build-ubuntu:
build-ubuntu-amd64:
runs-on: ubuntu-latest

steps:
Expand All @@ -20,10 +25,12 @@ jobs:
- uses: zowe-actions/shared-actions/prepare-workflow@main

- uses: zowe-actions/shared-actions/docker-prepare@main
env:
ZLUX_DOWNLOAD_API_TOKEN: ${{ secrets.ZLUX_API_TOKEN }}
with:
registry-user: ${{ secrets.ARTIFACTORY_X_USERNAME }}
registry-password: ${{ secrets.ARTIFACTORY_X_PASSWORD }}
release: ${{ env.RELEASE }}
release: ${{ github.event.inputs.release }}
base-directory: ${{ env.IMAGE_BASE_DIR }}
image-name: app-server
linux-distro: ubuntu
Expand All @@ -34,18 +41,46 @@ jobs:
build-arg-list: ZOWE_BASE_IMAGE=latest-ubuntu
timeout-minutes: 5

build-zlinux:

build-ubi-amd64:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: zowe-actions/shared-actions/prepare-workflow@main

- uses: zowe-actions/shared-actions/docker-prepare@main
env:
ZLUX_DOWNLOAD_API_TOKEN: ${{ secrets.ZLUX_API_TOKEN }}
with:
registry-user: ${{ secrets.ARTIFACTORY_X_USERNAME }}
registry-password: ${{ secrets.ARTIFACTORY_X_PASSWORD }}
release: ${{ github.event.inputs.release }}
base-directory: ${{ env.IMAGE_BASE_DIR }}
image-name: app-server
linux-distro: ubi
cpu-arch: amd64

- uses: zowe-actions/shared-actions/docker-build-local@main
with:
build-arg-list: ZOWE_BASE_IMAGE=latest-ubi
timeout-minutes: 5

build-ubuntu-s390x:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: zowe-actions/shared-actions/prepare-workflow@main

- uses: zowe-actions/shared-actions/docker-prepare@main
env:
ZLUX_DOWNLOAD_API_TOKEN: ${{ secrets.ZLUX_API_TOKEN }}
with:
registry-user: ${{ secrets.ARTIFACTORY_X_USERNAME }}
registry-password: ${{ secrets.ARTIFACTORY_X_PASSWORD }}
release: ${{ env.RELEASE }}
release: ${{ github.event.inputs.release }}
base-directory: ${{ env.IMAGE_BASE_DIR }}
image-name: app-server
linux-distro: ubuntu
Expand All @@ -58,4 +93,91 @@ jobs:
zlinux-ssh-key: ${{ secrets.ZLINUX_SSH_KEY }}
zlinux-ssh-passphrase: ${{ secrets.ZLINUX_SSH_PASSPHRASE }}
build-arg-list: ZOWE_BASE_IMAGE=latest-ubuntu
timeout-minutes: 10
timeout-minutes: 10


build-ubi-s390x:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: zowe-actions/shared-actions/prepare-workflow@main

- uses: zowe-actions/shared-actions/docker-prepare@main
env:
ZLUX_DOWNLOAD_API_TOKEN: ${{ secrets.ZLUX_API_TOKEN }}
with:
registry-user: ${{ secrets.ARTIFACTORY_X_USERNAME }}
registry-password: ${{ secrets.ARTIFACTORY_X_PASSWORD }}
release: ${{ github.event.inputs.release }}
base-directory: ${{ env.IMAGE_BASE_DIR }}
image-name: app-server
linux-distro: ubi
cpu-arch: s390x

- uses: zowe-actions/shared-actions/docker-build-zlinux@main
with:
zlinux-host: ${{ secrets.ZLINUX_HOST }}
zlinux-ssh-user: ${{ secrets.ZLINUX_SSH_USER }}
zlinux-ssh-key: ${{ secrets.ZLINUX_SSH_KEY }}
zlinux-ssh-passphrase: ${{ secrets.ZLINUX_SSH_PASSPHRASE }}
build-arg-list: ZOWE_BASE_IMAGE=latest-ubi
timeout-minutes: 10


define-ubuntu-manifest:
needs:
- build-ubuntu-amd64
- build-ubuntu-s390x
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: zowe-actions/shared-actions/prepare-workflow@main

- uses: zowe-actions/shared-actions/docker-prepare@main
env:
ZLUX_DOWNLOAD_API_TOKEN: ${{ secrets.ZLUX_API_TOKEN }}
with:
registry-user: ${{ secrets.ARTIFACTORY_X_USERNAME }}
registry-password: ${{ secrets.ARTIFACTORY_X_PASSWORD }}
release: ${{ github.event.inputs.release }}
base-directory: ${{ env.IMAGE_BASE_DIR }}
image-name: app-server
linux-distro: ubuntu

- uses: zowe-actions/shared-actions/docker-manifest@main
with:
linux-distro: ubuntu
primary-linux-distro: ubuntu
cpu-arch-list: "amd64 s390x"
timeout-minutes: 2

define-ubi-manifest:
needs:
- build-ubi-amd64
- build-ubi-s390x
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: zowe-actions/shared-actions/prepare-workflow@main

- uses: zowe-actions/shared-actions/docker-prepare@main
env:
ZLUX_DOWNLOAD_API_TOKEN: ${{ secrets.ZLUX_API_TOKEN }}
with:
registry-user: ${{ secrets.ARTIFACTORY_X_USERNAME }}
registry-password: ${{ secrets.ARTIFACTORY_X_PASSWORD }}
release: ${{ github.event.inputs.release }}
base-directory: ${{ env.IMAGE_BASE_DIR }}
image-name: app-server
linux-distro: ubi

- uses: zowe-actions/shared-actions/docker-manifest@main
with:
linux-distro: ubi
primary-linux-distro: ubuntu
cpu-arch-list: "amd64 s390x"
timeout-minutes: 2

56 changes: 26 additions & 30 deletions container/Dockerfile.zlux
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,47 @@ FROM zowe-docker-release.jfrog.io/ompzowe/base-node:${ZOWE_BASE_IMAGE} AS builde
##################################
# labels
LABEL name="App Server" \
maintainer="jstruga@rocketsoftware.component" \
maintainer="jstruga@rocketsoftware.com" \
vendor="Zowe" \
version="0.0.0" \
release="0" \
description="This Zowe UI component can display jobs running on z/OS"
summary="Zowe App Server, Desktop, and builtin plugins" \
description="A core Zowe component that powers the Desktop and Desktop Apps"

EXPOSE 8544/tcp


#ENV VARS
ENV INSTALL_DIR=/component
ENV ROOT_DIR=${INSTALL_DIR}/install
ENV ZWED_INSTALL_DIR=/component
ENV ROOT_DIR=/home/zowe/runtime
ENV ZOWE_ROOT_DIR=${ROOT_DIR}
ENV INSTANCE_DIR=${INSTALL_DIR}/instance
ENV INSTANCE_DIR=/home/zowe/instance
ENV WORKSPACE_DIR=${INSTANCE_DIR}/workspace

# COPY zlux-core to /home/zowe/install/components/app-server/share
ADD files/zlux-core.tar ${ROOT_DIR}/components/app-server/share/
# copy all packages & scripts to install
ADD files ${INSTALL_DIR}/files
# Testing parameters
# ENV ZOWE_EXPLORER_HOST='localhost'
# ENV ZWED_node_allowInvalidTLSProxy=true
# ENV ZWE_EXTERNAL_HOST='localhost'

RUN cd ${ROOT_DIR}/components/app-server/share/zlux-app-server/bin && \
chmod +x *.sh && \
./install-container.sh
# authorization needs to point to zss endpoint
# ENV APIML_SECURITY_AUTHORIZATION_PROVIDER=endpoint
# ENV APIML_SECURITY_AUTHORIZATION_ENDPOINT_ENABLED=true

EXPOSE 8544/tcp

ENV ZOWE_EXPLORER_HOST='localhost'
ENV ZOWE_IP_ADDRESS=0.0.0.0
# zlux minus plugins
ADD --chown=zowe:zowe files/zlux-core.tar ${ZWED_INSTALL_DIR}/share/
# copy config and plugins
ADD --chown=zowe:zowe files ${ZWED_INSTALL_DIR}/files

ENV ZOWE_ZOSMF_PORT='443'
ENV ZWED_agent_https_port='8542'
RUN chown -R zowe:zowe ${ZWED_INSTALL_DIR}
USER zowe

ENV ZWED_node_allowInvalidTLSProxy=true
ENV ZOWE_ZLUX_TELNET_PORT=23
ENV ZOWE_ZLUX_SECURITY_TYPE=telnet
ENV ZWE_EXTERNAL_HOST='localhost'
ENV ZWE_REFERRER_HOSTS='localhost,gateway-service,zlux-app-server'
RUN if [ ! -d ${ZWED_INSTALL_DIR}/share/zlux-app-server ]; then cd ${ZWED_INSTALL_DIR}/share && tar -xf zlux-core.tar; fi

# authorization needs to point to zss endpoint
# ENV APIML_SECURITY_AUTHORIZATION_PROVIDER=endpoint
# ENV APIML_SECURITY_AUTHORIZATION_ENDPOINT_ENABLED=true

# ENV LAUNCH_COMPONENT_GROUPS=DESKTOP,GATEWAY

# COPY --chown=zowe:zowe --from=builder /home/zowe /home/zowe
# RUN chmod a+x /home/zowe/*.sh /home/zowe/.run_inner.sh
RUN cd ${ZWED_INSTALL_DIR}/share/zlux-app-server/bin && \
chmod +x *.sh && \
./install-container.sh

WORKDIR ${ROOT_DIR}/components/app-server/bin
WORKDIR ${ZWED_INSTALL_DIR}/bin
CMD ["./start-container.sh"]
5 changes: 3 additions & 2 deletions container/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
#########################################################################################

mkdir -p logs
docker pull zowe-docker-release.jfrog.io/ompzowe/base-node:latest-ubuntu
docker build --pull -f Dockerfile.zlux --no-cache --progress=plain -t zowe-docker-snapshot.jfrog.io/ompzowe/app-server:testing . 2>&1 | tee logs/docker-build.log
docker pull zowe-docker-release.jfrog.io/ompzowe/base-node:$ZOWE_BASE_IMAGE
docker build --pull -f Dockerfile.zlux --no-cache --progress=plain --build-arg ZOWE_BASE_IMAGE=$ZOWE_BASE_IMAGE -t zowe-docker-snapshot.jfrog.io/ompzowe/app-server:testing . 2>&1 | tee logs/docker-build.log

79 changes: 70 additions & 9 deletions container/getPackagePaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,86 @@
#########################################################################################
*/

if (!process.env.ZLUX_DOWNLOAD_API_TOKEN) {
console.log('*** WARNING: This will not download patterned URLs without environment variable ZLUX_DOWNLOAD_API_TOKEN. Set with for example export ZLUX_DOWNLOAD_API_TOKEN=... ***');
}


const { binaryDependencies: zowePackages } = require('./files/manifest.json');
const baseUrl = process.env.ZOWE_REPOSITORY || 'https://zowe.jfrog.io/artifactory';
function getPackageUrls() {
async function getPackageUrls() {
let zluxPrefix = 'org.zowe.zlux';
let urls = []
let packages = []
let packages = []
for (const [key, value] of Object.entries(zowePackages)) {
if (key.startsWith(zluxPrefix)) {
let packageName = key.replace(zluxPrefix + '.', '');
packages.push(packageName)
let { repository, version, artifact } = value;
urls.push(`${baseUrl}/${repository}/org/zowe/zlux/${packageName}/${version}/${artifact.replace('.pax', '.tar')}`);
let { repository, version, artifact } = value;
if (key.startsWith(zluxPrefix)) {
let { repository, version, artifact } = value;
if (repository == 'libs-snapshot-local'){
let packageName = key.replace(zluxPrefix + '.', '');
packages.push(packageName)
urls.push(`${baseUrl}/${repository}/org/zowe/zlux/${packageName}/${version}/${artifact.replace('.pax', '.tar')}`);
}else{
let packageName = key.replace(zluxPrefix + '.', '');
let versionName = value['version'].replace('~', '');
let artifactName = value['artifact'].replace('.pax', '.tar')
let result = await artifactory(packageName, versionName, artifactName);
packages.push(packageName)
urls.push(`${baseUrl}/${result}`);

}
}
}
//console.log(urls);
//console.log(urls);
return `${packages.toString()};${urls.toString()}`;
}

console.log(getPackageUrls())
getPackageUrls().then(res => console.log(res));


function findArtifact(name, version, artifact){
return new Promise(resolve => {
const https = require('https')
const data = `items.find({"repo": "libs-snapshot-local", "path": {"$match": "org/zowe/zlux/${name}/*${version}"}, "name": {"$match": "${artifact}"}})`
const options ={
hostname: 'zowe.jfrog.io',
path: '/zowe/api/search/aql',
method: 'POST',
headers: {
'X-JFrog-Art-Api':process.env.ZLUX_DOWNLOAD_API_TOKEN ? process.env.ZLUX_DOWNLOAD_API_TOKEN : '*'
}
}

var ret = '';
const req = https.request(options, (res) => {
//console.log(`statusCode: ${res.statusCode}`)
res.on('data', (d) => {
ret += d;
})
res.on('error', (err) => {
})
res.on('end', () => {
resolve(JSON.parse(ret));
})
});
req.write(data)
req.end();
})
}

function sortArtifacts(names){
return names['results'].sort(function(a,b){
return b.updated.localeCompare(a.updated, undefined, {
numeric: true,
sensitivity: 'base'
});
});

}

async function artifactory(name, version, artifact){
data = await findArtifact(name, version, artifact);
sortArtifacts(data)
let results = data['results'][0]['repo'] + '/' + data['results'][0]['path'] + '/' + data['results'][0]['name']
return results
}
7 changes: 6 additions & 1 deletion container/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ if [ ! -f download-zlux.sh ]; then
exit 4
fi
./pull-zowe-install-artifacts.sh

if [ -z "${ZLUX_DOWNLOAD_API_TOKEN}" ]; then
echo "*** WARNING: This will not download patterned URLs without environment variable ZLUX_DOWNLOAD_API_TOKEN. Set with for example export ZLUX_DOWNLOAD_API_TOKEN=... ***"
fi

./download-zlux.sh

###############################
Expand Down Expand Up @@ -140,4 +145,4 @@ cp -r "${BASE_DIR}/${WORK_DIR}/." "${BASE_DIR}/${linux_distro}/${cpu_arch}"

###############################
# done
echo ">>>>> all done"
echo ">>>>> all done"
4 changes: 2 additions & 2 deletions container/pull-zowe-install-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ rm -rf files/zowe-install-packaging 2>/dev/null
mkdir -p files/zlux

# clone zowe-install-packaging - copy manifest, files/zlux/config
git clone --branch rc https://github.com/zowe/zowe-install-packaging files/zowe-install-packaging
git clone --branch staging https://github.com/zowe/zowe-install-packaging files/zowe-install-packaging

# copy manifest to files
mv files/zowe-install-packaging/manifest.json.template files/manifest.json

#cp files/zowe-install-packaging/manifest.json.template files/manifest.json
mv files/zowe-install-packaging/files/zlux/config files/zlux/config
# clear zowe-install-packaging
rm -rf files/zowe-install-packaging
rm -rf files/zowe-install-packaging
Loading

0 comments on commit b71b202

Please sign in to comment.