Skip to content

Commit 9cb32f0

Browse files
committed
Add bind mount requirements top enable fast reload of Actor source
1 parent e358f2a commit 9cb32f0

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

requirements/actor-driver.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
- Actor build log is saved in `__LOGS__` internal storage
3939
- Actor details are saved in `__ACTORS__` internal storage
4040

41+
# Bind mount volumes with Actor source code
42+
- To enable rapid development of Actors, it is desired to avoid the need to rebuild the Actors. This can be achieved by bind mounting the actor local development folder when starting the container.
43+
- When building an Actor, get the location where the Actor source code is locally located and save it in `__ACTORS__` under `localDevFolder`
44+
- Detect the working directory of docker image `docker inspect -f '{{.Config.WorkingDir}}' {DOCKER_IMAGE}` (replace {DOCKER_IMAGE} by the docker image identifier) and save it to `__ACTORS__` under `imageWorkingDirectory`
45+
- Each Actor stored by the local Actor runtime is started with bind mounted development folder using these additional arguments `-v {localDevFolder}:{imageWorkingDirectory} -v {imageWorkingDirectory}/node_modules`
46+
4147
# Networking
4248

4349
- On startup, the runtime detects its own container id, ensures a Docker network `apify-local`

requirements/storage.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
- `value` is the metadata of the Actor
7272
- owner (`userId`)
7373
- metadata
74+
- localDevFolder
75+
- imageWorkingDirectory
7476
- The system stores Actor runs in dedicated key-value store called `__RUNS__`:
7577
- `key` is the id of the Actor run `runId`
7678
- `value` is the metadata of the Actor

0 commit comments

Comments
 (0)