feat: Added MySQL example#380
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new MySQL example to the Unikraft Cloud examples repository, including packaging (Dockerfile + Kraftfile), a usage guide, and an end-to-end pytest that validates the deployment via a TLS-wrapped port mapping.
Changes:
- Add
mysql/example with a scratch-based rootfs and a startup wrapper that initializes and launchesmysqld. - Add
mysql/README.mdwith deployment and connectivity instructions (includingsocattunneling). - Add
mysql/test_mysql.pyend-to-end test and link the new example from the top-levelREADME.md.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds the MySQL example to the examples table. |
| mysql/Dockerfile | Builds a minimal scratch rootfs containing MySQL binaries/libs and the wrapper script. |
| mysql/Kraftfile | Declares runtime/rootfs and sets the command to the wrapper script. |
| mysql/README.md | Documents how to build, deploy, connect (via socat), and use volumes. |
| mysql/test_mysql.py | Adds an end-to-end test that deploys MySQL and runs basic SQL checks. |
| mysql/wrapper.sh | Initializes the datadir, generates init SQL, and starts mysqld. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| echo "Starting MySQL process..." | ||
|
|
||
| exec /usr/sbin/mysqld --user=root --log-bin --init-file=/tmp/dynamic_init.sql |
48062f1 to
c16ab5d
Compare
c16ab5d to
01863fd
Compare
nurof3n
left a comment
There was a problem hiding this comment.
LGTM!
Reviewed-by: Alex-Andrei Cioc andrei.cioc@unikraft.io
Approved-by: Alex-Andrei Cioc andrei.cioc@unikraft.io
| COPY --from=build /lib/x86_64-linux-gnu/libpcre2-8.so.0 \ | ||
| /lib/x86_64-linux-gnu/libselinux.so.1 \ | ||
| /lib/x86_64-linux-gnu/libtinfo.so.6 \ | ||
| /lib/x86_64-linux-gnu/libacl.so.1 \ |
|
|
||
| # User database | ||
| COPY --from=build /etc/passwd /etc/passwd | ||
| COPY --from=build /etc/shadow /etc/shadow |
There was a problem hiding this comment.
Spacing is inconsistent here
|
|
||
| **Using the legacy kraft CLI** | ||
| ```bash title="kraft" | ||
| kraft cloud deploy --scale-to-zero idle --scale-to-zero-cooldown 1s --scale-to-zero-stateful -p 443:8080/tls+http -M 1Gi . |
There was a problem hiding this comment.
This command does not match the unikraft command
01863fd to
2a747ef
Compare
Signed-off-by: Dragos Gheorghioiu <dragosg@unikraft.com>
2a747ef to
886b714
Compare
Closes: FIELD-500