Skip to content

Commit 9913442

Browse files
committed
partial work
1 parent e2c359e commit 9913442

File tree

10 files changed

+322
-174
lines changed

10 files changed

+322
-174
lines changed

compose/file-system/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/sandialabs/sync-journal/journal-sdk:1.0.1
1+
FROM ghcr.io/sandialabs/sync-journal/journal-sdk:1.0.3
22

33
ARG REPOSITORY=https://raw.githubusercontent.com/sandialabs/sync-records/965c839ac6bed6db24541ba642089e8fa8063633/lisp/
44

compose/file-system/docker-compose.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
security_opt:
1515
- apparmor:unconfined
1616
ports:
17-
- 445:445
17+
- ${SAMBA_PORT:-445}:445
1818
networks:
1919
- docker
2020
environment:
@@ -23,25 +23,20 @@ services:
2323
SAMBA_SECRET: ${SAMBA_SECRET:-secret}
2424
SAMBA_SHARE: ${SAMBA_SHARE:-data}
2525
volumes:
26-
- ./data-back:/data-back
27-
28-
cryptography:
29-
image: ghcr.io/sandialabs/sync-services/cryptography:1.0.0
30-
container_name: cryptography
31-
networks:
32-
- docker
26+
- ./data-back:/srv/data-back
3327

3428
journal:
35-
image: ghcr.io/sandialabs/sync-services/ledger:1.0.0
29+
image: ghcr.io/sandialabs/sync-services/ledger:1.0.1
3630
container_name: journal
3731
networks:
3832
- docker
39-
depends_on:
40-
- cryptography
4133
environment:
4234
SECRET: ${SECRET}
4335
PERIODICITY: ${PERIODICITY:-2}
44-
CRYPTOGRAPHY: http://cryptography.docker
36+
WINDOW: ${WINDOW:-1024}
37+
RUST_LOG: ${RUST_LOG:-info}
38+
volumes:
39+
- database:/srv/database
4540

4641
interface:
4742
image: nginx:stable-alpine
@@ -54,3 +49,6 @@ services:
5449
- docker
5550
ports:
5651
- "${PORT:-8192}:80"
52+
53+
volumes:
54+
database:

compose/file-system/file-system.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
file-system-file-make!
3939
file-system-file-read
4040
file-system-file-write!
41-
file-system-file-delet!)))
41+
file-system-file-delete!)))
4242
(if (null? functions) #t
4343
;; todo: wrap the function to access ledger
4444
;; - pass in ledger instead of record

compose/file-system/notes.org

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1+
* overall thoughts
2+
- general purpose would be better...
3+
- implies that there is not a file-system.scm extension, right? right?
14
* conclusion
5+
- question: should file system be a pure explorer?
26
- the file-system thing is just a separate use case, not general-purpose explorer
7+
- differences between FS and sync web data models
8+
- empty directories
9+
- most attributes will be undefined and chmod/chown not possible
10+
- could have a default file/directory and add optional (chmod/chown stuff)
11+
- maybe that could go in a mirrored *state* *fs* folder
12+
- lack of ability to build in more complex data
13+
- scalability (do I really want to save a pdf as bytes in rocksdb?)
14+
- why not?
15+
- is everything just a text file unless it's bytes?
316
* idea:
417
- need function to check expression (maybe at control level?)
518
* paths
@@ -19,3 +32,10 @@
1932
- if parses as expression, then do expression
2033
- if ascii, then string
2134
- if not ascii, then bytes
35+
* dones
36+
- figure out why there is such a long loop process start startup
37+
* Todos
38+
- get chmod/chown/etc to work
39+
- **really need to figure this out** get long documents to work
40+
- handle refcount deletes
41+
- have real directory attributes

compose/file-system/run.sh

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,17 @@ if [ -z "$SECRET" ]; then
55
exit 1
66
fi
77

8+
if [ -z "$WINDOW" ]; then
9+
WINDOW="#f"
10+
fi
11+
12+
if [ -z "$RUST_LOG" ]; then
13+
RUST_LOG="info"
14+
fi
15+
816
record=$( cat record.scm )
917
control=$( cat control.scm )
1018
ledger=$( cat ledger.scm )
19+
file_system=$( cat file-system.scm )
1120

12-
check_status() {
13-
while true; do
14-
echo "Polling for cryptography service"
15-
response=$( wget -qO - "$1" 2>/dev/null)
16-
if [ -n "$response" ]; then
17-
return 0
18-
else
19-
sleep 1
20-
fi
21-
done
22-
}
23-
24-
check_status "${CRYPTOGRAPHY}/signature/key/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
25-
26-
./journal-sdk -b "($record \"$SECRET\" $control ($ledger \"$CRYPTOGRAPHY\" #t #f) $preload)" -s "(*step* \"$SECRET\")" -p 80 -c $PERIODICITY
21+
RUST_LOG=$RUST_LOG ./journal-sdk -b "($record \"$SECRET\" $control ($ledger \"$SECRET\" #f $WINDOW) $file_system)" -s "(*step* \"$SECRET\")" -p 80 -c $PERIODICITY -d database

services/fuse/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
env/

services/fuse/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ RUN apk update
88
RUN apk --no-cache add tini bash samba tzdata shadow fuse-dev
99
ENV FUSE_LIBRARY_PATH=/usr/lib/libfuse.so
1010

11+
COPY requirements.txt .
12+
RUN pip install -r requirements.txt
13+
1114
RUN addgroup -S smb
1215
RUN rm -f /etc/samba/smb.conf && rm -rf /tmp/* /var/cache/apk/*
1316

@@ -28,8 +31,6 @@ ENV RW=true
2831

2932
HEALTHCHECK --interval=60s --timeout=15s CMD smbclient --configfile=/etc/samba.conf -L \\localhost -U % -m SMB3
3033

31-
COPY requirements.txt .
32-
RUN pip install -r requirements.txt
3334
COPY service.py .
3435

3536
RUN echo "user_allow_other" >> /etc/fuse.conf

services/fuse/notes.org

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,13 @@
2323
- 5
2424
- 6
2525
- ... for the last X files
26+
-
27+
28+
* Okay... so how do I handle the flush/release crap?
29+
- if storing separately:
30+
- store in back-end file system
31+
- update the hash on release
32+
- store in memory
33+
- maintain case of access -> write -> release
34+
- store in sync web
35+
- write every time

0 commit comments

Comments
 (0)