{"id":21923764,"url":"https://github.com/soujava/spring-with-crac","last_synced_at":"2025-10-09T16:31:22.297Z","repository":{"id":251504113,"uuid":"837529687","full_name":"soujava/spring-with-crac","owner":"soujava","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-03T13:58:40.000Z","size":16,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-03T04:41:21.640Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soujava.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-03T08:46:13.000Z","updated_at":"2024-08-08T22:33:22.000Z","dependencies_parsed_at":"2024-08-03T15:10:16.060Z","dependency_job_id":null,"html_url":"https://github.com/soujava/spring-with-crac","commit_stats":null,"previous_names":["soujava/spring-with-crac"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/soujava/spring-with-crac","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soujava%2Fspring-with-crac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soujava%2Fspring-with-crac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soujava%2Fspring-with-crac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soujava%2Fspring-with-crac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soujava","download_url":"https://codeload.github.com/soujava/spring-with-crac/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soujava%2Fspring-with-crac/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001766,"owners_count":26083171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T21:12:44.681Z","updated_at":"2025-10-09T16:31:21.459Z","avatar_url":"https://github.com/soujava.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Exploring Spring Boot with CraC\n:toc:\n\n== Setup the environment\n\n=== Installing a JDK with support for CRaC:\n\n==== Download and install the JDK with CRaC support\n\n1. Download the JDK with CRaC support from https://www.azul.com/downloads/?package=jdk-crac#zulu[Azul Zulu website]:\n- link:https://cdn.azul.com/zulu/bin/zulu22.30.13-ca-crac-jdk22.0.1-linux_x64.tar.gz[Azul Zulu 22.0.1 + CRaC X64]\n- link:https://cdn.azul.com/zulu/bin/zulu21.30.13-ca-crac-jdk22.0.1-linux_aarch64.tar.gz[Azul Zulu 22.0.1 + CRaC AARCH64]\n\n2. Unpack the tar.gz file and copy the JDK in a folder\n+\n[source, bash]\n----\nsudo tar zxvf zulu22.30.13-ca-crac-jdk22.0.1-linux_x64.tar.gz\n----\n3. Move to the folder where the JDK installation will be located\n+\n[source, bash]\n----\nmv zulu22.30.13-ca-crac-jdk22.0.1-linux_x64 zulu-22.jdk\nmv zulu-22.jdk /usr/lib/jvm\n----\n4. Set the $JAVA_HOME environment variable to the JDK with CRaC support e.g.\n+\n[source, bash]\n----\nexport JAVA_HOME=/usr/lib/jvm/zulu-22.jdk\n----\n\n=== install the JDK with CRaC support via SDKMAN\n\n* Install a JDK with CRaC support via SDKMAN:\n+\n[source, bash]\n----\nsdk install java 22.0.1.crac-zulu\n----\n\n\n== Grant permissions to run CRIU\n\n\n. Make sure you have the permissions to run CRIU:\n\n+\n[source, bash]\n----\nsudo chown root:root $JAVA_HOME/lib/criu\n----\n+\n[source, bash]\n----\nsudo chmod u+s $JAVA_HOME/lib/criu\n----\n\n== Build the application\n\n. Open the project folder and run:\n+\n[source, bash]\n----\n./mvnw verify\n----\n\n. Now you should find the `spring-with-crac-0.0.1-SNAPSHOT.jar` jar at `target/` directory\n. Create a folder named `tmp_manual_checkpoint` in the project folder (besides the `src` folder)\n\n\n== Start and initialize the MySQL database+\n[source,bash]\n----\nsh create-manual-checkpoint.sh \u003ctarget/spring-with-crac-0.0.1-SNAPSHOT.jar or PID\u003e\n----\n\n. Start the MySQL database using Docker Compose\n\n+\n[source,bash]\n----\ndocker compose up -d\n----\n\n== Start the application without any CRaC\n\n. Start the application normally\n\n+\n[source,bash]\n----\n./mvnw spring-boot:run\n----\n\n[NOTE]\n====\nA checkpoint can also be compressed (only in Azul Zulu) on the hard drive by executing:\n\n`export CRAC_CRIU_OPTS=--compress`\n\n====\n\nThere is a shell script for starting up the app with CRaC support:\n\n- start-manual-crac.sh\n\nSo you simply have to un-comment it in this shell script.\nBe aware that the compression at checkpoint and decompression at restoring will take longer.\nMeaning to say the restore will be slower when using a compressed checkpoint (on my machine used here it takes around 150ms to de-compress the checkpoint)\n\n== Start the application and create a checkpoint manually after application startup\n\n. Make sure the folder `tmp_manual_checkpoint` exists\n. Remove all files from the folder `tmp_manual_checkpoint` with:\n+\n[source,bash]\n----\nrm -f ./tmp_manual_checkpoint/*.*\n----\n\n. Start the application\n+\n[source,bash]\n----\nsh start-manual-crac.sh\n----\n\n== Create the manual checkpoint\n\nThere are two ways of creating the checkpoint manually, calling the application jar or the pid\n\n. Calling the application jar\n+\n[source,bash]\n----\njcmd target/spring-with-crac-0.0.1-SNAPSHOT.jar JDK.checkpoint\n----\n\n+\nor executing the `create-manual-checkpoint.sh` script with the PID (can be found in the output in the 1st shell window)\n+\n[source,bash]\n----\nsh create-manual-checkpoint.sh target/spring-with-crac-0.0.1-SNAPSHOT.jar\n----\nOR\n+\n[source,bash]\n----\nsh create-manual-checkpoint.sh \u003cPID\u003e\n----\n. Check if the checkpoint files have been stored in `./tmp_manual_checkpoint`\n\n== Restore the application from the manually created checkpoint\n\n1. Restore the application from the stored checkpoint by executing\n+\n[source,bash]\n----\nsh restore-manual-crac.sh\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoujava%2Fspring-with-crac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoujava%2Fspring-with-crac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoujava%2Fspring-with-crac/lists"}