Skip to content

Commit

Permalink
fix: try to fix marlin enclave image building
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Jul 18, 2024
1 parent c693f45 commit 71295a5
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 11 deletions.
6 changes: 3 additions & 3 deletions 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
Expand Up @@ -15,7 +15,7 @@ strip = true
opt-level = 's'

[workspace.package]
version = "1.1.2"
version = "1.1.3"
edition = "2021"
repository = "https://github.com/ldclabs/idempotent-proxy"
keywords = ["idempotent", "reverse", "proxy", "icp"]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ In a new terminal, run
cd /mnt/my-server
sudo docker exec -it nitro-cli sh
# or docker pull enclave image
docker build -f enclave/arm64.Dockerfile -t enclave_arm64:latest .
nitro-cli build-enclave --docker-uri enclave_arm64:latest --output-file enclave_arm64.eif
docker build -f enclave/amd64.Dockerfile -t enclave_amd64:latest .
nitro-cli build-enclave --docker-uri enclave_amd64:latest --output-file enclave_amd64.eif
```

### Running as Cloudflare Worker
Expand Down
8 changes: 8 additions & 0 deletions enclave/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SERVER_ADDR=127.0.0.1:8088
POLL_INTERVAL=100 # in milliseconds
REQUEST_TIMEOUT=20000 # in milliseconds
LOG_LEVEL=warn # debug, info, warn, error
# cert file path to enable https, for example: /etc/https/mydomain.crt
TLS_CERT_FILE = ""
# key file path to enable https, for example: /etc/https/mydomain.key
TLS_KEY_FILE = ""
3 changes: 2 additions & 1 deletion enclave/amd64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ COPY enclave/setup.sh ./
RUN chmod +x setup.sh

# your custom setup goes here
COPY --from=builder /src/.env ./.env
# COPY enclave/.env ./.env
COPY enclave/.env ../.env
COPY --from=builder /src/target/release/idempotent-proxy-server ./idempotent-proxy-server

# entry point
Expand Down
5 changes: 3 additions & 2 deletions enclave/arm64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ COPY enclave/setup.sh ./
RUN chmod +x setup.sh

# your custom setup goes here
COPY --from=builder /src/.env ./.env
# COPY enclave/.env ./.env
COPY enclave/.env ../.env
COPY --from=builder /src/target/release/idempotent-proxy-server ./idempotent-proxy-server

# entry point
ENTRYPOINT [ "/app/setup.sh" ]
ENTRYPOINT [ "./idempotent-proxy-server" ]
2 changes: 1 addition & 1 deletion enclave/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ iptables -L -t nat

# starting supervisord
cat /etc/supervisord.conf
/app/supervisord
/app/supervisord
10 changes: 9 additions & 1 deletion enclave/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,19 @@ stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0

[program:idempotent-proxy-server-proxy]
command=/app/vsock-to-ip --vsock-addr 88:1200 --ip-addr 127.0.0.1:8088
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0

# your custom programs go here
[program:idempotent-proxy-server]
command=/app/idempotent-proxy-server
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
stderr_logfile_maxbytes=0

0 comments on commit 71295a5

Please sign in to comment.