Skip to content

Commit

Permalink
Merge pull request #15 from rbanffy/develop
Browse files Browse the repository at this point in the history
Merge develop into master for version 1.4
  • Loading branch information
rbanffy authored Oct 7, 2023
2 parents 422bf8f + 9ad96e2 commit fa8ff38
Show file tree
Hide file tree
Showing 8 changed files with 205 additions and 58 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/shiftleft-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ name: SL Scan

on:
push:
branches: [ master, develop ]
branches: [ main, develop ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [ main ]
schedule:
- cron: '45 17 * * 1'

Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
## current
## 1.4

- Improve image tagging ("latest" is from develop, "stable" is from main)
- Added Dockerfiles for VM370 Community Edition and MVS Tk4-
- Improved README
- LOGOFF the operator so it can be used from a 3270
- Enable the web interface
- Enable DOS disks
- Expose only TCP for terminal connection
- Add comments to build process
- Avoid APT questions
- Add a hercules non-privileged user

## 1.3
Expand Down
25 changes: 0 additions & 25 deletions Dockerfile

This file was deleted.

33 changes: 33 additions & 0 deletions Dockerfile-mvstk4
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM debian:testing-slim

LABEL maintainer="Ricardo Bánffy <[email protected]>"

ARG USERNAME=hercules
ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN DEBIAN_FRONTEND=noninteractive \
groupadd --gid $USER_GID $USERNAME && \
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME && \
apt update && \
apt upgrade -y && \
apt install -y --no-install-recommends hercules wget unzip && \
cd /home/$USERNAME && \
wget --no-check-certificate https://wotho.ethz.ch/tk4-/tk4-_v1.00_current.zip && \
wget --no-check-certificate https://wotho.ethz.ch/tk4-/tk4-cbt.zip && \
wget --no-check-certificate https://wotho.ethz.ch/tk4-/tk4-source.zip && \
unzip tk4-_v1.00_current.zip && \
unzip -o tk4-cbt.zip && \
unzip -o tk4-source.zip && \
# Remove unwanted files.
apt purge -y wget unzip && \
rm -rf /var/lib/apt/lists/* *.zip && \
chown -R $USERNAME:$USERNAME /home/$USERNAME

USER $USERNAME
WORKDIR /home/$USERNAME

EXPOSE 3270/TCP
EXPOSE 8038/TCP

CMD ["./mvs"]
36 changes: 36 additions & 0 deletions Dockerfile-vm370
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM debian:testing-slim

LABEL maintainer="Ricardo Bánffy <[email protected]>"

ARG USERNAME=hercules
ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN DEBIAN_FRONTEND=noninteractive \
groupadd --gid $USER_GID $USERNAME && \
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME && \
apt update && \
apt upgrade -y && \
apt install -y --no-install-recommends hercules wget unzip && \
cd /home/$USERNAME && \
wget http://www.smrcc.org.uk/members/g4ugm/vm-370/vm370sixpack-1_3.zip && \
unzip vm370sixpack-1_3.zip && \
# Remove unwanted files.
apt purge -y wget unzip && \
rm -rf /var/lib/apt/lists/* vm370sixpack-1_3.zip WC3270 && \
# Enable CMS/DOS disks.
sed -i 's/#06a0/06a0/' sixpack.conf && \
sed -i 's/#07a0/07a0/' sixpack.conf && \
# Enable web UI with the MAINT credentials
sed -i 's/#HTTPPORT 8081/HTTPPORT 8081 AUTH MAINT CPCMS/' sixpack.conf && \
# Log off the OPERATOR user from the Hercules console
echo '/LOGOFF' >> hercules.rc && \
chown -R $USERNAME:$USERNAME /home/$USERNAME

USER $USERNAME
WORKDIR /home/$USERNAME

EXPOSE 3270/TCP
EXPOSE 8081/TCP

CMD ["hercules", "-f", "sixpack.conf"]
42 changes: 42 additions & 0 deletions Dockerfile-vm370ce
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM debian:testing-slim

LABEL maintainer="Ricardo Bánffy <[email protected]>"

ARG USERNAME=hercules
ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN DEBIAN_FRONTEND=noninteractive \
groupadd --gid $USER_GID $USERNAME && \
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME && \
apt update && \
apt upgrade -y && \
apt install -y --no-install-recommends hercules wget unzip && \
cd /home/$USERNAME && \
wget http://www.vm370.org/sites/default/files/2022-07/VM370CE.V1.R1.2.zip && \
wget http://dosvs.31bits.net/DOSVS_5Pack_V1.0-full.zip && \
unzip VM370CE.V1.R1.2.zip && \
mv VM370CE.V1.R1.2/* . && \
unzip DOSVS_5Pack_V1.0-full.zip -d disks && \
# Enable DOS/VS devices.
sed -i 's/#0361/0361/' vm370ce.conf && \
sed -i 's/#0362/0362/' vm370ce.conf && \
sed -i 's/#0363/0363/' vm370ce.conf && \
sed -i 's/#0364/0364/' vm370ce.conf && \
# Remove unwanted files.
apt purge -y wget unzip && \
rm -rf /var/lib/apt/lists/* && \
rm -rf VM370CE.V1.R1.2.zip WC3270 VM370CE.V1.R1.2 DOSVS_5Pack_V1.0-full.zip && \
# Enable web UI with the MAINT credentials
sed -i 's/#HTTPPORT 8081/HTTPPORT 8081 AUTH MAINT CPCMS/' vm370ce.conf && \
# Log off the OPERATOR user from the Hercules console
echo '/LOGOFF' >> hercules.rc && \
chown -R $USERNAME:$USERNAME /home/$USERNAME

USER $USERNAME
WORKDIR /home/$USERNAME

EXPOSE 3270/TCP
EXPOSE 8081/TCP

CMD ["hercules", "-f", "vm370ce.conf"]
50 changes: 24 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

SHELL = /bin/sh

OPERATING_SYSTEM ?= vm370
BRANCH = $(shell git branch --show-current)

ifeq ($(BRANCH),main)
Expand All @@ -29,33 +30,30 @@ help: ## Displays this message.
@python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

build: ## Builds the Docker images
docker build -t ${USER}/vm370:${IMAGE_TAG}-amd64 --platform=linux/amd64 .
docker build -t ${USER}/vm370:${IMAGE_TAG}-arm64 --platform=linux/arm64 .
docker build -t ${USER}/vm370:${IMAGE_TAG}-armv6 --platform=linux/arm/v6 .
docker build -t ${USER}/vm370:${IMAGE_TAG}-armv7 --platform=linux/arm/v7 .
docker build -t ${USER}/vm370:${IMAGE_TAG}-i386 --platform=linux/i386 .
docker build -t ${USER}/vm370:${IMAGE_TAG}-mips64le --platform=linux/mips64le .
docker build -t ${USER}/vm370:${IMAGE_TAG}-ppc64le --platform=linux/ppc64le .
docker build -t ${USER}/vm370:${IMAGE_TAG}-s390x --platform=linux/s390x .
docker build -t ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-amd64 --platform=linux/amd64 --file Dockerfile-${OPERATING_SYSTEM} .
docker build -t ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-arm64 --platform=linux/arm64 --file ./Dockerfile-${OPERATING_SYSTEM} .
docker build -t ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-armv6 --platform=linux/arm/v6 --file ./Dockerfile-${OPERATING_SYSTEM} .
docker build -t ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-armv7 --platform=linux/arm/v7 --file ./Dockerfile-${OPERATING_SYSTEM} .
docker build -t ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-s390x --platform=linux/s390x --file ./Dockerfile-${OPERATING_SYSTEM} .
docker build -t ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-ppc64le --platform=linux/ppc64le --file ./Dockerfile-${OPERATING_SYSTEM} .

start: build ## Builds and starts the local arch Docker image
docker start -d -p 3270:3270 ${OPERATING_SYSTEM}

upload_images: ## Uploads the docker images
docker image push ${USER}/vm370:${IMAGE_TAG}-amd64
docker image push ${USER}/vm370:${IMAGE_TAG}-arm64
docker image push ${USER}/vm370:${IMAGE_TAG}-armv6
docker image push ${USER}/vm370:${IMAGE_TAG}-armv7
docker image push ${USER}/vm370:${IMAGE_TAG}-i386
docker image push ${USER}/vm370:${IMAGE_TAG}-mips64le
docker image push ${USER}/vm370:${IMAGE_TAG}-ppc64le
docker image push ${USER}/vm370:${IMAGE_TAG}-s390x
docker image push ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-amd64
docker image push ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-arm64
docker image push ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-armv6
docker image push ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-armv7
docker image push ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-s390x
docker image push ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-ppc64le

upload: upload_images ## Uploads the manifest
docker manifest create ${USER}/vm370:${IMAGE_TAG} \
--amend ${USER}/vm370:${IMAGE_TAG}-amd64 \
--amend ${USER}/vm370:${IMAGE_TAG}-arm64 \
--amend ${USER}/vm370:${IMAGE_TAG}-armv6 \
--amend ${USER}/vm370:${IMAGE_TAG}-armv7 \
--amend ${USER}/vm370:${IMAGE_TAG}-i386 \
--amend ${USER}/vm370:${IMAGE_TAG}-mips64le \
--amend ${USER}/vm370:${IMAGE_TAG}-ppc64le \
--amend ${USER}/vm370:${IMAGE_TAG}-s390x
docker manifest push ${USER}/vm370:${IMAGE_TAG}
docker manifest create ${USER}/${OPERATING_SYSTEM}:latest \
--amend ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-amd64 \
--amend ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-amd64 \
--amend ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-armv6 \
--amend ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-armv7 \
--amend ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-s390x \
--amend ${USER}/${OPERATING_SYSTEM}:${IMAGE_TAG}-ppc64le
docker manifest push ${USER}/${OPERATING_SYSTEM}:latest
62 changes: 58 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,68 @@
[![Docker Pulls](https://img.shields.io/docker/pulls/rbanffy/vm370.svg)](https://hub.docker.com/r/rbanffy/vm370/)
[![GitHub](https://img.shields.io/github/license/rbanffy/vm370.svg)](https://github.com/rbanffy/vm370)

Docker image for rbanffy/vm370
This repo contains the files needed to build the Docker image for rbanffy/vm370.

![Screenshot](https://raw.githubusercontent.com/wiki/rbanffy/vm370/screenshot.png)

To run, use:
## Building the image

By default, we'll build the VM370 Six Pack image. To build it, run:

```shell
docker build -t vm370 .
```

To run the image you just built on an amd64 computer, use:

```shell
docker run -it -p 3270:3270 -p 8081:8081 $USER/vm370:latest-amd64
```

At this point, you can connect your terminals to localhost on port 3278. To
get to the web console, connect to http://localhost:8081 using the credentials
for the MAINT user (as published in the Sixpack documentation).

## Building an image with other OSs

By default we'll build based on Dockerfile-vm370. To select other Dockerfiles,
set the variable OPERATING_SYSTEM.

```shell
OPERATING_SYSTEM=vm370ce make build
```

## Running from Docker Hub

To run the VM370 Six Pack image without building it locally, use:

```shell
docker run -it -p 3270:3270 -p 8081:8081 rbanffy/vm370
```

MVS Tk4- uses port 8038 for the web console:

```shell
docker run -it -p 3270:3270 -p 8038:8038 rbanffy/mvstk4
```

## Deploying it to a Docker Swarm

This image is intended to run as a service on a cluster. To create a vm370
service on your cluster, run:

```shell
docker run -it -p 3270:3270 rbanffy/vm370
docker service create --name vm370 --publish 3270:3270 --publish 8081:8081 rbanffy/vm370
```

And connect your terminals to localhost on port 3278.
When the service is up and running, connecting a 3270 session to any node will
get you to the VM370 welcome screen.

### A warning

The web-based Hercules console is not working properly for the VM370 images at
the moment, but work correctly with MVS 3.8 Tk4- on port 8038.

A more serious issue is that data is not persisted beyond the life of the
container, or when the workload is moved to a new node. Use it at your own
peril (and, if you know how, help improving it).

0 comments on commit fa8ff38

Please sign in to comment.