Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
dylan-drummond
Contributor
5,790

Intro 

SAP offer a container image called Abap Platform Trial which enables you to run a HANA-based SAP System on your laptop or PC:

https://hub.docker.com/r/sapse/abap-platform-trial 

That site also provides the official advice from SAP on how to use Docker container-management software to get the container up and running on host machines with an amd64 architecture (a.k.a. “x86_64” or “Intel” architecture). 

Nowadays many developers and system admins (the likely users of Abap Platform Trial) are using M-series MacBooks, i.e. MacBooks with the “Apple Chips” which have an arm64 architecture and are named according to the chip version {M1, M2, M3, …}. But Abap Platform Trial is at the time of writing only available as an amd64 image, so this means that to run it on an M-series MacBook, some form of emulation is required - so this blog will describe two paths to spin up and run Abap Platform Trial containers on an M-series MacBook - BTW here is what success looks like:

murmelssonic_0-1706901014447.png

The two paths are: 

Path 1: use Docker Desktop with the feature released in mid-2023 to enable Apple Rosetta emulation - AFAIK this path is only available with Docker Desktop.

Path 2: use the UTM app with appropriate configurations to emulate via Apple QEMU an amd64 Linux distro  - this path works with Docker and Podman, and (I guess) quite possibly with other container-management tools.

Disclaimer: The demos of this blog, as well as writing the actual blog, were done in my spare time, on my own MacBook - there really is no SAP or other Helpdesk available if you get stuck trying to use this blog’s advice, it’s all about BYODS: Bring Your Own Debug Skills. But if there are errors in the text, feel free to suggest corrections. I did the demos on an M3 MacBook with macOS (Sonoma 14.2.1), but I guess the examples should work on other M-series MacBooks with a suitable macOS version. Also note that officially the host machine should have 32 GB of RAM available - maybe you can get by with less than that amount, though I haven’t tested that (as my machine has well over 32 GB RAM). 

 

Using Docker Desktop for M-series MacBooks

We download Docker Desktop:

https://www.docker.com/products/docker-desktop/ 

Our DMG will be the Docker Desktop for macOS (“Apple chip” i.e. M-series chip); from the DMG you install Docker Desktop to /Applications directory.

When you open Docker Desktop for the first time, you have to accept the Docker Subscription Service Agreement… Obviously if you are using Docker Desktop for work purposes of whatever organisation you belong to, you have to work out between you and your employer etc whether you need a paid subscription (not a consideration for me on my home computer doing this in my free time).

Next we choose to “Use recommended settings (requires password)” for the final setup steps (where the actual Docker Engine is installed to do the hard work behind the scenes of the Docker Desktop GUI stuff), and press “Finish”. then supply your computer user’s admin password when prompted. 

Next step is a choice between Signing Up for a Docker Hub account, or Signing In if you already have such an account, or Continue without signing in. Well, although SAP used to offer the predecessor product “Abap Trial” only via login to Docker Hub, however for the current product Abap Platform Trial, no such login to Docker Hub is required (the SAP website for that image claims that such a login is required, but at the time of writing that claim is false 😀).

So I’m not going to bother signing in to Docker Hub (even though I have had an account there since 2015); instead we choose “Continue without signing in” for now (you can always create an account and/or sign in later if you need to). Then if you like you can tell Docker about yourself in the screen “Tell us about the work you do”, though I just pressed Skip, which takes us to the main Docker Desktop window where all the icons for Images, Containers etc are situated. From there near top right we can go to the Settings screen using the cog icon, in the tab “General” we find 3 important settings, which were switched on by default, so no changes needed but it is good to review these settings a bit:

murmelssonic_1-1706901014999.png

Zoom in on those 3 a bit:

murmelssonic_2-1706901014478.png

The first one is “Use Virtualisation framework”, which is greyed out (unmodifiable) because it has to be switched on when using the second setting “Choose file sharing…. VirtioFS”. We keep this as is. Also we keep the third setting “Use Rosetta for x86/amd64 emulation on Apple Silicon” as is, because this is exactly the feature that appeared in 2023 and enabled people to finally succeed in using Docker Desktop for Abap Platform Trial (which is an amd64-only image).

FYI Docker, like Podman or any other Linux Container Management tools, can only work on non-Linux computers by running a Linux VM in the background - it is inside this Linux VM where the actual containers are run. We go to the Settings tab “Resources” where basically what we can specify are the main parameters of this Linux VM (for Docker the VM is based on LinuxKit); we will need a bigger and faster VM than what is provided by default, so let’s adjust the Resources settings:

CPU limit: 6 should be enough

Memory limit: 28 GB. (You might get away with less than that, I am just saying what worked for me).

Swap limit: 2 GB

Virtual disk limit: 248 GB (the nearest selectable value to 250 GB I found on the slider). Probably you can get by with a slightly smaller disk size, I am just telling yous what works for me, but remember kids, the image takes up over 50GB on disk, and then you want at least 120 GB for the container that contains a whole HANA-based SAP System, plus the Linux VM’s OS footprint takes up some space as well.

Resource Saver [not shown in screenshot below]: Keep the default settings (Enabled, etc)

Then press “Apply & restart” to save the changes and restart Docker Engine.

ddresources.png

 

Enable Rosetta on MacBook

If you haven’t already enabled Apple Rosetta, or you are unsure, we can make sure that it is enabled by, well, enabling it (make sure you are connected to the Internet as the software is downloaded from Apple’s servers):

 

sudo softwareupdate --install-rosetta --agree-to-license

 

You can ignore a warning about the installKbytes attribute, instead we trust the message that says Rosetta 2 was installed successfully; you can also open the System Report, Software, Installations and scroll down till you find an entry including the Rosetta AutoUpdater package “RosettaUpdateAuto” (which was installed as part of Rosetta):

Screenshot 2024-02-02 at 22.26.58.png

Done, now we can get the image we need and spin up the container…

 

Pull and spin up Abap Platform Trial

There are two ways to do this: using the command line (i.e. using Docker Engine, which you installed as part of Docker Desktop setup), or using the GUI app (Docker Desktop, which in the background will be using Docker Engine anyway). The command line method is:

 

sudo docker pull sapse/abap-platform-trial:1909_SP01

 

The GUI app method is to search in the top bar of Docker Desktop for the image, then press Pull:

murmelssonic_5-1706901014431.png

The pull operation will take some time because there is over 20 GB of stuff to download, then it all has to be extracted and written to the local image repo of the Docker VM, so you just need to be patient. If the process fails, then start it again (either from GUI app or command line). Eventually you should succeed and the image will be viewable in Docker Desktop’s Images tab and via the command:

 

sudo docker images

 

Docker Desktop warns us that this is an amd64 image:

murmelssonic_6-1706901014373.png

Since the image is only available as amd64, and since we have the relevant emulation settings configured via Docker Desktop, we remain confident that this is going to work out fine.

Next task is to spin up the a4h container, I am going to do this from the command line as that way we easily get to specify all the options we want and we can immediately follow the stdout info of the command’s progress… make sure Docker Desktop is running (as that starts up Docker Engine for us)… then the command I am going with is:

 

sudo docker run --stop-timeout 3600 -it --name a4h -h vhcala4hci -p 3200:3200 -p 3300:3300 -p 3601:3601 -p 8443:8443 -p 30213:30213 -p 50000:50000 -p 50001:50001 sapse/abap-platform-trial:1909_SP01 -skip-limits-check -agree-to-sap-license

 

As well as following the Terminal window output, you can also follow the progress in Docker Desktop:

murmelssonic_7-1706901014475.png

Click on a4h and then the Logs tab shows the same stdout info. 

murmelssonic_8-1706901014459.png

Anyway, the SAP System is soon up and running, and because we are using Rosetta instead of a fully emulated VM, the procedure goes much faster, less than 3 minutes from ‘docker run’ to the SAP System up and running.

[We note this warning that occurred at the start of the docker run operation: “The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested”. But as this is only a warning, not an error, and as the catch-and-translate tasks are all handled fine with no specific errors appearing in stdout, then this warning isn’t something we need to worry about.]

We do a test of opening a SAPGUI session - note that for this test, where we typically want to use “vhcala4hci” as the hostname in the SAPGUI for Java Connection Item, i.e.:

/H/vhcala4hci/S/3200

…so we need to add a line (plus optionally an explanatory comment) to MacBook /etc/hosts file, for example:

# For accessing Abap Platform Trial container on localhost:

127.0.0.1       vhcala4hci  vhcala4hci.dummy.nodomain

You can modify the file from Terminal with:

 

sudo pico /etc/hosts

 

Use <Ctrl-0>, <Enter>, <Ctrl-X> to save and exit.

[Note that in this Docker for macOS case the container’s ports are accessed from localhost (i.e. the MacBook-as-host-itself), which has the IPv4 address 127.0.0.1 - remember kids, don’t touch the existing entry for localhost in /etc/hosts, especially don’t remove it; instead it’s perfectly ok to make a separate new entry mapping vhcala4hci to 127.0.0.1 - mapping multiple names to one IPv4 address is ok].

So the SAPGUI session opens just fine:

murmelssonic_9-1706901014476.png

Then exit SAPGUI, and shutdown the SAP System using <Ctrl-C> in Terminal session or using the Stop button for the container in Docker Desktop… it may take up to 10 minutes, the last steps involve telling Rosetta to let go of various HDB processes it is handling.

To restart the container, you can do that either from Docker Desktop or (assuming Docker Engine is running):

 

sudo docker start -ai a4h

 

 

Configuring an emulated amd64 Ubuntu Server VM for M-series MacBooks

Ubuntu Server can be downloaded from here:

https://ubuntu.com/download/server 

murmelssonic_10-1706901014678.png

Choose the latest LTS (Long Term Stable) release offered there.

You can get the UTM Hypervisor-Emulator here:

https://mac.getutm.app/ 

I have the paid version from App Store, as it wasn’t that expensive (one-time payment I guess) and you then get UTM updates pushed instead of having to update it yourself. 

Create a new VM. Choose Emulation. Choose Linux. Select the Ubuntu ISO file. Architecture: x86_64 (a.k.a. amd64), System: Standard PC (Q35+ICH9+2009). 

Memory, well, let’s try giving it 28GB of RAM, which is equivalent to 28672 MB (binary) according to our calculator:

https://www.gbmb.org/gb-to-mb 

So we enter 28672 as the MB value of RAM. 

Processors (processor cores, is the more accurate term maybe): 6 should be enough.

Leave the OpenGL checkbox unchecked.

Disk size: 250 GB.

No shared directory needed. Give the VM a name. Then go to VM Settings… System tab… click on the selection icon for CPU… there are two Intel Core i7 processors available, we will take the “Nehalem-v2” option as it contains the IBRS update which mitigates the Spectre vulnerability, otherwise it is the same as the “Nehalem-v1” option (which you can also use, if you like).

murmelssonic_11-1706901014310.png

We check to "on" the “Force multicore” checkbox. For the JIT Cache value, I put that to 3 GB (3072 MB), so that the VM has access to slightly less than 32 GB RAM (28+3=31). So we end up with this:

murmelssonic_12-1706901014486.png


Start the VM and install Ubuntu Server, using these options… Language: English (default, i.e. English (US)). Keyboard layout: whatever matches your keyboard e.g. Finnish, Finnish (Macintosh). Update to the new installer. Choose the “Ubuntu Server” default option. Accept whatever IPv4 address is offered by Hypervisor’s NAT. Let the default mirror location get tested ok. Use the entire disk but uncheck the option to create the disk as an LVM group. 

murmelssonic_13-1706901014479.png

Give the server this name: 

vhcala4hci

(According to the SAP advice, that is the only hostname of the server that the Abap Platform Trial will work with).

Skip the Ubuntu Pro option, not needed. Check to “on” the option “Install OpenSSH Server” as it’s very convenient to be able to SSH into this server. Do NOT choose any of the Server Snaps offered (especially do not choose the Docker snap). 

Ignore the “Install complete!” message in the screen that logs the progress of the installation, as we want to also let the workflow install any updates it wants e.g. security updates. Instead, wait until in the lower part of the screen the option to “Reboot now” appears:

murmelssonic_14-1706901014430.png

Modify /etc/hosts of the MacBook to map the Ubuntu Server to its IPv4 address, replacing the example IPv4 address with the IPv4 address of your Ubuntu VM:

 

sudo pico /etc/hosts

 

# For the Ubuntu Server that runs Abap Platform Trial:

192.168.64.2  vhcala4hci  vhcala4hci.dummy.nodomain

<Ctrl-O>, <Enter>, <Ctrl-X> to save and exit. (On MacBook, it’s the key called “control”, not the one called “command”). Note that if you earlier already setup Docker Desktop (first part of this blog) and thus already had a mapping in /etc/hosts for vhcala4hci to 127.0.0.1, you should delete that mapping or comment it out temporarily, as you cannot simultaneously map many IPv4 addresses to the one hostname.

Reboot and either login using the UTM console, or if you prefer SSH (good for copy-pasting commands), then login from the MacBook Terminal - for example, if your Ubuntu user is called “marmot”:

 

ssh marmot@vhcala4hci

 

Then we update the repos and upgrade the packages:

 

sudo apt update
sudo apt upgrade -y

 

For Ubuntu: Comment out the “127.0.1.1 vhcala4hci” line from /etc/hosts - this is needed to prevent the SAP system getting confused.

 

sudo nano /etc/hosts

 

#Comment out as it can confuse SAP

#127.0.1.1 vhcala4hci

After that you can choose to either install Docker or install Podman - I recommend not having both utilities installed on the same VM at the same time, as that may cause problems; instead I installed them on separate VMs in the demos described below.

 

Abap Platform Trial with Docker on the Ubuntu Server VM

Install Docker, using the official advice here (modified that advice by replacing “apt-get” commands with “apt”, as it’s 2024 and “apt” has been the standard for many years now on Ubuntu):

https://docs.docker.com/engine/install/ubuntu/ 

 

# Add Docker's official GPG key:
sudo apt update
sudo apt install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# Add the repository to Apt sources:
echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update

sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

sudo docker run hello-world

 

Assuming this all goes smoothly, the hello-world container runs, prints a greeting, and exits. You can check the version installed, if you like:

 

docker --version

 

murmelssonic_15-1706901014400.png

Maybe reboot just to make sure all the processes are using the newest versions of everything. Then we can pull the image, which in late January 2024 is version 1909_SP01:

 

sudo docker pull sapse/abap-platform-trial:1909_SP01

 

Takes a while, as 20 GB of stuff needs to get downloaded, extracted and written to docker’s local repo. Once done, we can check the image is there:

 

sudo docker images

 

Ok, now we want to run it. To minimise warnings about limits (although we will include the option to prevent limits-checking from resulting in a fatal error, still the warnings will be given if something not configured right), we will first set two sysctl options statically:

 

sudo sysctl vm.max_map_count=2147483647
sudo sysctl fs.aio-max-nr=18446744073709551615

 

Then we try the docker run command, ours is this one (the --sysctl and --ulimit parameters are optional):

 

sudo docker run --stop-timeout 3600 -it --name a4h -h vhcala4hci -p 3200:3200 -p 3300:3300 -p 3601:3601 -p 8443:8443 -p 30213:30213 -p 50000:50000 -p 50001:50001 --sysctl kernel.shmmni=32768 --ulimit nofile=1048576:1048576 sapse/abap-platform-trial:1909_SP01 -skip-limits-check -agree-to-sap-license

 

Due to the full emulation, the SAP System may take about 15 minutes to get up and running. Once it is running, you can do the SAPGUI session test mentioned above in the Docker Desktop section. Then you can use the <Ctrl-C> option in the Ubuntu terminal session to shutdown the SAP System and container. To restart, use:

 

sudo docker start -ai a4h

 

 

Abap Platform Trial with Podman on the Ubuntu Server VM

Install Podman:

 

sudo apt install podman

 

Test with hello-podman:

 

podman pull quay.io/podman/hello
podman run quay.io/podman/hello

 

murmelssonic_16-1706901014480.png

Note that by default, podman doesn’t need to be run as the sudo (root) user. Now we can pull the Abap Platform Trial image:

 

podman pull docker.io/sapse/abap-platform-trial:1909_SP01

 

Compared to docker pull, the podman pull is more prone to giving up and/or ending in error during the download of a large image. The only solution is to retry the pull operation until it works. In my testing, about 10% of the time a retry was needed. After pulling the image, it can be seen in the local repo:

 

podman image list

 

Then we set the sysctl parameters (optional) and spin up the container (the --sysctl and --ulimit parameters are also optional):

 

sudo sysctl vm.max_map_count=2147483647
sudo sysctl fs.aio-max-nr=18446744073709551615
podman run --stop-timeout 3600 -it --name a4h -h vhcala4hci -p 3200:3200 -p 3300:3300 -p 3601:3601 -p 8443:8443 -p 30213:30213 -p 50000:50000 -p 50001:50001 --ulimit nofile=1048576:1048576 sapse/abap-platform-trial:1909_SP01 -skip-limits-check -agree-to-sap-license

 

This takes around 10-15 minutes to get to the success state:

murmelssonic_17-1706901014447.png

We check we can get to the SAPGUI logon screen… ok. Then exit from SAPGUI, and shutdown the container from console or SSH session using <Ctrl-C>. To restart the container, use:

 

podman start -ai a4h

 

 

Closing remarks

The first path (Docker Desktop) has the advantage that installing and using the SAP System on the container works faster, this is due to Apple Rosetta only emulating the calls that require emulation (whereas in the case of amd64 Ubuntu Server, we emulate the whole VM). It also involves less setup work. 

The second path (emulated Ubuntu Server) has the advantage that you are not restricted to Docker as the only viable container-manager; also, you don’t need to install any container-management software directly on your MacBook (as that is installed on the Linux VM).

In this blog we don’t talk much about what to do after spinning up the container successfully - if you need advice on those post-spinup-tasks, like logging in to the SAP System, getting an A4H license etcetera, there is the official advice from SAP on the Abap Platform Trial site: https://hub.docker.com/r/sapse/abap-platform-trial  

Also you can find similar advice in my January 2024 blog for using Podman for Abap Platform Trial with amd64 hosts (sections “Configuring the A4H System” and “Stopping and starting the container”): https://community.sap.com/t5/devops-and-system-administration-blogs/using-podman-for-abap-platform-t...

Good luck now with whichever path to Abap Platform Trial container glory you take.

19 Comments
Labels in this area