CRaC / docs

225 stars 13 forks source link

Debug: Can't get debug logging to work #16

Closed Celludriel closed 1 year ago

Celludriel commented 1 year ago

Hey,

We are trying to figure out why our container is doing a cold start instead of from the checkpoint. So we wanted to add more debug logging with the documented VM parameter

-XX:CREngine=criuengine,--verbosity=4,--log-file=/path/to/log.txt

However each time we try and run the container following error pops up

Starting Checkpoint OpenJDK 64-Bit Server VM warning: Could not find /opt/jdk/lib/criuengine,--verbosity=4,--log-file=/log/log.txt: No such file or directory OpenJDK 64-Bit Server VM warning: cannot restore Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

We created the log volume and are exposing it in the container

sudo podman run -v log:/log --privileged --security-opt systempaths=unconfined --security-opt apparmor=unconfined --rm -p 8080:8080 --name application-api qpks/application-api:checkpoint

We are running privileged to see it work later on we'll work on those permissions to make it secure.

We based our setup on the spring boot demo: https://github.com/sdeleuze/spring-boot-crac-demo

rvansa commented 1 year ago

Hi @Celludriel , I guess that you're using an older release that does not include commit https://github.com/openjdk/crac/commit/ddf6a0550ddb2d6aa61640bb82317c003e52df3d - could you verify that you're using the latest build 17+6? https://github.com/CRaC/openjdk-builds/releases/tag/17-crac%2B6

Celludriel commented 1 year ago

@rvansa

Do you mean the following ?

case $(uname -m) in
    arm64)   url="https://cdn.azul.com/zulu/bin/zulu17.44.55-ca-crac-jdk17.0.8.1-linux_aarch64.tar.gz" ;;
    *)       url="https://cdn.azul.com/zulu/bin/zulu17.44.55-ca-crac-jdk17.0.8.1-linux_x64.tar.gz" ;;
esac

This is the jdk we have been using

the following is what we use in our pom

<dependency>
    <groupId>org.crac</groupId>
    <artifactId>crac</artifactId>
    <version>1.4.0</version>
</dependency>
Celludriel commented 1 year ago

Hey

We got it working with following snippet

#!/usr/bin/env bash
set -e

url="https://github.com/CRaC/openjdk-builds/releases/download/17-crac%2B6/openjdk-17-crac+6_linux-x64.tar.gz"
echo "Using CRaC enabled JDK $url"

#mvn clean package -DskipTests
sudo podman build -t qpks/application-api:builder --build-arg CRAC_JDK_URL=$url .

We realised after a while we where using the wrong jdk (azul instead of openjdk) The application still cold starts but now we actually have debug logging

Thank you for the replies

rvansa commented 1 year ago

It's not a 'wrong jdk', though your build is not the most recent and does not have the change in; if you prefer Azul builds please use one of these:

https://cdn.azul.com/zulu/bin/zulu17.46.27-ca-crac-jdk17.0.9-linux_x64.tar.gz
https://cdn.azul.com/zulu/bin/zulu17.46.27-ca-crac-jdk17.0.9-linux_aarch64.tar.gz

I will close this issue.