Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5b2e8d5
chore: refine the draft volume spec
queil Jan 17, 2026
4e080e5
wip
queil Jan 24, 2026
eb33163
add: make sure mounts paths use valid declared data entries
queil Jan 27, 2026
159558c
wip
queil Jan 27, 2026
eefa082
breaking: removed implicit volume backing /work dir
queil Jan 27, 2026
eaa1ecc
refac: move logic to allow sharing data by sidecars
queil Jan 27, 2026
e87a5d2
refactor: volume_name
queil Jan 28, 2026
4b2b048
add: v2 mounts support for sidecars
queil Jan 28, 2026
c178452
chore: tidy up + add file scenario
queil Jan 28, 2026
bdb91da
add: support for provisioning single files stage 1
queil Jan 29, 2026
a00b9a4
chore: add more typing to avoid errors
queil Jan 29, 2026
559be4a
chore: proper mess but implemented populating volumes
queil Jan 29, 2026
cffcf3f
add: symlinks - it seems to work
queil Jan 29, 2026
64d6d2d
chore: bump + update
queil Jan 29, 2026
33423da
fix: ensure files cmd gen
queil Jan 29, 2026
880d5d6
fix: chown use uid, not user
queil Jan 29, 2026
19ac522
fix: chown the symlink itself
queil Jan 29, 2026
c727c53
fix: the files volume should be always mounted at the shadow root dir
queil Jan 29, 2026
d264ecd
fix: only populate volumes if were just created
queil Jan 30, 2026
c1a4708
fix: make dir on populating files
queil Jan 30, 2026
8131eac
fix: make dir on populating files correctly in v2
queil Jan 30, 2026
503b8fa
fix: add implicit work volume mounted at /work - user definition take…
queil Jan 30, 2026
e6d00ed
fix:serde
queil Jan 31, 2026
72ab0c1
chore: remove bloat
queil Jan 31, 2026
9d5dbaf
restore: legacy mounts as inline_mounts
queil Jan 31, 2026
78e572f
chore: fix legacy test file
queil Jan 31, 2026
8b9b899
remove old file
queil Jan 31, 2026
e0ce3e4
add: implement inline mounts
queil Jan 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rooz"
version = "0.143.0"
version = "0.144.0"
edition = "2024"

[dependencies]
Expand Down
203 changes: 102 additions & 101 deletions examples/sidecar-config.yaml
Original file line number Diff line number Diff line change
@@ -1,128 +1,129 @@
secrets:
sqlPwd: '-----BEGIN AGE ENCRYPTED FILE-----|YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBFRXNpZ2lucE5WNnNWTllM|TmNhMGpPWS9rSmVoNVFjVTNrZDJCUHFPaFFRCkVwL3VmZ2Z1RXBuOEtobmVyTW93|d0xjTzhtd1VtbWR1bE1wLzRqZnpjbXMKLT4gM3BAJWJKbS1ncmVhc2Uga09DCm9z|ZWRnRm9qUGFCa0xjODFCRjVnRTJOUXV6ZW1vd3Y5Y2hhZlpycHBWQQotLS0gM1Fy|dEtocUJSQWhEdnc4SnI5OW5BUE55OFVPdzhvWWJ0Y1hzRHFaMUFqbwobXxftWwA7|N4qqKac4hWDTO3Y1Lt/jczL5UoqM//tpmJwJW9ASja6T0xyTglM=|-----END AGE ENCRYPTED FILE-----|'
#sqlPwd: '-----BEGIN AGE ENCRYPTED FILE-----|YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBFRXNpZ2lucE5WNnNWTllM|TmNhMGpPWS9rSmVoNVFjVTNrZDJCUHFPaFFRCkVwL3VmZ2Z1RXBuOEtobmVyTW93|d0xjTzhtd1VtbWR1bE1wLzRqZnpjbXMKLT4gM3BAJWJKbS1ncmVhc2Uga09DCm9z|ZWRnRm9qUGFCa0xjODFCRjVnRTJOUXV6ZW1vd3Y5Y2hhZlpycHBWQQotLS0gM1Fy|dEtocUJSQWhEdnc4SnI5OW5BUE55OFVPdzhvWWJ0Y1hzRHFaMUFqbwobXxftWwA7|N4qqKac4hWDTO3Y1Lt/jczL5UoqM//tpmJwJW9ASja6T0xyTglM=|-----END AGE ENCRYPTED FILE-----|'
sidecars:
sqledge:
image: mcr.microsoft.com/azure-sql-edge:latest
env:
ACCEPT_EULA: ${ACCEPT_EULA}
MSSQL_SA_PASSWORD: '{{ sqlPwd }}'
#MSSQL_SA_PASSWORD: '{{ sqlPwd }}'
emulator:
image: mcr.microsoft.com/azure-messaging/servicebus-emulator:latest
env:
SQL_SERVER: sqledge
MSSQL_SA_PASSWORD: '{{ sqlPwd }}'
#MSSQL_SA_PASSWORD: '{{ sqlPwd }}'
ACCEPT_EULA: Y
mounts:
legacy_mounts:
- /my_test/data/
- mount: /work/ConfigFiles/Config.json
content: |
{
"UserConfig": {
"Namespaces": [
{
"Name": "sbemulatorns",
"Queues": [
{
"Name": "queue.1",
"Properties": {
"DeadLetteringOnMessageExpiration": false,
"DefaultMessageTimeToLive": "PT1H",
"DuplicateDetectionHistoryTimeWindow": "PT20S",
"ForwardDeadLetteredMessagesTo": "",
"ForwardTo": "",
"LockDuration": "PT1M",
"MaxDeliveryCount": 10,
"RequiresDuplicateDetection": false,
"RequiresSession": false
- mount: /work/ConfigFiles/
files:
Config.json: |
{
"UserConfig": {
"Namespaces": [
{
"Name": "sbemulatorns",
"Queues": [
{
"Name": "queue.1",
"Properties": {
"DeadLetteringOnMessageExpiration": false,
"DefaultMessageTimeToLive": "PT1H",
"DuplicateDetectionHistoryTimeWindow": "PT20S",
"ForwardDeadLetteredMessagesTo": "",
"ForwardTo": "",
"LockDuration": "PT1M",
"MaxDeliveryCount": 10,
"RequiresDuplicateDetection": false,
"RequiresSession": false
}
}
}
],
"Topics": [
{
"Name": "topic.1",
"Properties": {
"DefaultMessageTimeToLive": "PT1H",
"DuplicateDetectionHistoryTimeWindow": "PT20S",
"RequiresDuplicateDetection": false
},
"Subscriptions": [
{
"Name": "subscription.1",
"Properties": {
"DeadLetteringOnMessageExpiration": false,
"DefaultMessageTimeToLive": "PT1H",
"LockDuration": "PT1M",
"MaxDeliveryCount": 10,
"ForwardDeadLetteredMessagesTo": "",
"ForwardTo": "",
"RequiresSession": false
},
"Rules": [
{
"Name": "app-prop-filter-1",
"Properties": {
"FilterType": "Correlation",
"CorrelationFilter": {
"ContentType": "application/text",
"CorrelationId": "id1",
"Label": "subject1",
"MessageId": "msgid1",
"ReplyTo": "someQueue",
"ReplyToSessionId": "sessionId",
"SessionId": "session1",
"To": "xyz"
],
"Topics": [
{
"Name": "topic.1",
"Properties": {
"DefaultMessageTimeToLive": "PT1H",
"DuplicateDetectionHistoryTimeWindow": "PT20S",
"RequiresDuplicateDetection": false
},
"Subscriptions": [
{
"Name": "subscription.1",
"Properties": {
"DeadLetteringOnMessageExpiration": false,
"DefaultMessageTimeToLive": "PT1H",
"LockDuration": "PT1M",
"MaxDeliveryCount": 10,
"ForwardDeadLetteredMessagesTo": "",
"ForwardTo": "",
"RequiresSession": false
},
"Rules": [
{
"Name": "app-prop-filter-1",
"Properties": {
"FilterType": "Correlation",
"CorrelationFilter": {
"ContentType": "application/text",
"CorrelationId": "id1",
"Label": "subject1",
"MessageId": "msgid1",
"ReplyTo": "someQueue",
"ReplyToSessionId": "sessionId",
"SessionId": "session1",
"To": "xyz"
}
}
}
}
]
},
{
"Name": "subscription.2",
"Properties": {
"DeadLetteringOnMessageExpiration": false,
"DefaultMessageTimeToLive": "PT1H",
"LockDuration": "PT1M",
"MaxDeliveryCount": 10,
"ForwardDeadLetteredMessagesTo": "",
"ForwardTo": "",
"RequiresSession": false
]
},
"Rules": [
{
"Name": "user-prop-filter-1",
"Properties": {
"FilterType": "Correlation",
"CorrelationFilter": {
"Properties": {
"prop3": "value3"
{
"Name": "subscription.2",
"Properties": {
"DeadLetteringOnMessageExpiration": false,
"DefaultMessageTimeToLive": "PT1H",
"LockDuration": "PT1M",
"MaxDeliveryCount": 10,
"ForwardDeadLetteredMessagesTo": "",
"ForwardTo": "",
"RequiresSession": false
},
"Rules": [
{
"Name": "user-prop-filter-1",
"Properties": {
"FilterType": "Correlation",
"CorrelationFilter": {
"Properties": {
"prop3": "value3"
}
}
}
}
]
},
{
"Name": "subscription.3",
"Properties": {
"DeadLetteringOnMessageExpiration": false,
"DefaultMessageTimeToLive": "PT1H",
"LockDuration": "PT1M",
"MaxDeliveryCount": 10,
"ForwardDeadLetteredMessagesTo": "",
"ForwardTo": "",
"RequiresSession": false
}
]
},
{
"Name": "subscription.3",
"Properties": {
"DeadLetteringOnMessageExpiration": false,
"DefaultMessageTimeToLive": "PT1H",
"LockDuration": "PT1M",
"MaxDeliveryCount": 10,
"ForwardDeadLetteredMessagesTo": "",
"ForwardTo": "",
"RequiresSession": false
}
}
]
}
]
]
}
]
}
],
"Logging": {
"Type": "File"
}
],
"Logging": {
"Type": "File"
}
}
}

ports:
- 5672:5672
37 changes: 37 additions & 0 deletions examples/volume-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
data:
empty-dir: {}
work: {}

git-config:
content: |-
[url "[email protected]:"]
insteadOf = gh:

# files included from paths are non-trivial at the moment for config originating from git
# rather trivial for local files, but I'd rather provide a consistent implementation
#local-file:
# path: ./local.yaml

mounts:
~/placeholder: empty-dir
/work: work
~/.gitconfig: git-config
~/.bash_history:
content: ""
# TODO: KNOWN ISSUE - backing different mount paths by the same data entry crashes when trying to cat/edit such
# a file

sidecars:
dkr:
image: docker.io/docker:28-dind-rootless
env:
DOCKER_TLS_CERTDIR: ''
DOCKER_TLS_VERIFY: ''
args:
- --tls=false
- --host=tcp://0.0.0.0:2375
privileged: true
init: false
mounts:
/var/placeholder: empty-dir
/root/.gitconfig: git-config
43 changes: 40 additions & 3 deletions src/api/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ use bollard::{
};
use futures::{Stream, StreamExt};

use std::{io::Read, time::Duration};

use crate::model::types::{TargetDir, VolumeFilesSpec};
use crossterm::terminal::{disable_raw_mode, enable_raw_mode};
use std::collections::HashMap;
use std::{io::Read, time::Duration};
use tokio::{
io::{AsyncWriteExt, unix::AsyncFd},
select, spawn,
Expand Down Expand Up @@ -285,12 +286,48 @@ impl<'a> ExecApi<'a> {
Ok(())
}

pub async fn symlink_files(
&self,
container_id: &str,
mounts: &HashMap<TargetDir, VolumeFilesSpec>,
uid: &str,
) -> Result<(), AnyError> {
for (_, spec) in mounts {
for file in &spec.files {
log::debug!(
"Creating symlink: {} -> {}",
&file.user_file.as_str(),
&file.target_file.as_str()
);

let cmd = format!(
"mkdir -p $(dirname {0}) && ln -sf {1} {0} && chown -h {2}:{2} {0}",
&file.user_file.as_str().replace("~", "${ROOZ_META_HOME}"),
&file.target_file.as_str(),
uid
);

let output = self
.output(
"symlink",
container_id,
Some(constants::ROOT_USER),
Some(vec!["sh", "-c", &cmd]),
)
.await?;

log::debug!("{}", output);
}
}
Ok(())
}

pub async fn ensure_user(&self, container_id: &str) -> Result<(), AnyError> {
let ensure_user_cmd = container::inject(
format!(
r#"grep -q "^$ROOZ_META_USER:x:$ROOZ_META_UID" /etc/passwd && exit 0
sed -i "/:x:${{ROOZ_META_UID}}/d" /etc/passwd && \
echo "$ROOZ_META_USER:x:$ROOZ_META_UID:$ROOZ_META_UID:$ROOZ_META_USER:$ROOZ_META_HOME:/bin/sh" >> /etc/passwd"#,
echo "$ROOZ_META_USER:x:$ROOZ_META_UID:$ROOZ_META_UID:$ROOZ_META_USER:$ROOZ_META_HOME:/bin/sh" >> /etc/passwd"#,
)
.as_ref(),
"make_user.sh",
Expand Down
Loading
Loading