You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/local-development.md
+12-18Lines changed: 12 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,11 +73,7 @@ To use Apify Proxy from local runs, set `APIFY_PROXY_PASSWORD` on the runtime co
73
73
74
74
## View the results
75
75
76
-
Everything a run produced is available in three places.
77
-
78
-
### Console
79
-
80
-
Open [http://localhost:3000](http://localhost:3000). The Console lists Actors, builds, runs, logs, and storages. A run's detail page links to its default storages, and log views render ANSI colours. The Console accepts the URL shapes Apify CLI prints for the Apify Console, so links in `apify call` output open the right page.
76
+
Everything a run produced is available in two places.
81
77
82
78
### CLI
83
79
@@ -117,7 +113,7 @@ For Actors with a slow build, such as browser images or heavy Python installs, t
117
113
apify call --input '{"maxPages": 3}'
118
114
```
119
115
120
-
To clear the registration, submit an empty body: `--body '""'`. The same field is on the Actor's page in the Console.
116
+
To clear the registration, submit an empty body: `--body '""'`.
121
117
122
118
**How the mount behaves**
123
119
@@ -160,13 +156,13 @@ apify api POST /actor-runtime/debug/<actorId> --body '{"enabled": false}'
160
156
161
157
The platform stops, migrates, and aborts Actors. You can trigger these events against a `RUNNING` run to check that your Actor persists its state and resumes correctly.
| Migration | `apify api POST /actor-runtime/migrate/<runId>`, or the **Migrate** button on the run's Console page | A `migrating` event, then its container stops about five seconds later and a new container starts for the same run with the same id, environment, and storages. In-memory state is gone. The status stays `RUNNING`. |
166
-
| Reboot | `apify api POST v2/actor-runs/<runId>/reboot` | An immediate stop and restart with no warning event. The SDKs call this from their default migration handler. |
167
-
| Graceful abort | `apify api POST 'v2/actor-runs/<runId>/abort?gracefully=true'` | `aborting` and `persistState` events, then the container stops 30 seconds later. |
168
-
| Abort | `apify api POST v2/actor-runs/<runId>/abort` | The container stops at once. |
169
-
| Timeout | `apify call --timeout 10` | The run ends as `TIMED-OUT` when the deadline passes. The budget is per run, so a migrated run gets only the remaining time. |
| Migration | `apify api POST /actor-runtime/migrate/<runId>` | A `migrating` event, then its container stops about five seconds later and a new container starts for the same run with the same id, environment, and storages. In-memory state is gone. The status stays `RUNNING`. |
162
+
| Reboot | `apify api POST v2/actor-runs/<runId>/reboot` | An immediate stop and restart with no warning event. The SDKs call this from their default migration handler. |
163
+
| Graceful abort | `apify api POST 'v2/actor-runs/<runId>/abort?gracefully=true'` | `aborting` and `persistState` events, then the container stops 30 seconds later. |
164
+
| Abort | `apify api POST v2/actor-runs/<runId>/abort` | The container stops at once. |
165
+
| Timeout | `apify call --timeout 10` | The run ends as `TIMED-OUT` when the deadline passes. The budget is per run, so a migrated run gets only the remaining time. |
170
166
171
167
The run log is cumulative across restarts, with a marker line between container incarnations.
172
168
@@ -178,8 +174,6 @@ Each distinct token gets its own user, and API responses are scoped to that user
178
174
apify api v2/datasets -H '{"authorization": "Bearer another-token"}'
179
175
```
180
176
181
-
The Console has no login and shows every user's objects with their owner, which helps you verify that scoping works.
182
-
183
177
## Fall back to the Apify platform
184
178
185
179
If a call fails because the runtime does not have that Actor, run, or storage id, or does not implement the endpoint, you can have such calls relayed to the Apify platform:
@@ -189,7 +183,7 @@ apify api POST /actor-runtime/api-fallback --body '{"fallbackUnimplementedEnable
189
183
apify api GET /actor-runtime/api-fallback
190
184
```
191
185
192
-
Both toggles are off by default and reset on every restart. The same toggles are on the Console's Settings page. Relayed responses carry the `x-actor-runtime-fallback` and `x-actor-runtime-fallback-trigger` headers so you can tell where an answer came from.
186
+
Both toggles are off by default and reset on every restart. Relayed responses carry the `x-actor-runtime-fallback` and `x-actor-runtime-fallback-trigger` headers so you can tell where an answer came from.
193
187
194
188
**Use a token you trust with real writes**
195
189
@@ -210,13 +204,13 @@ The runtime is a development tool for one developer: fewer than ten Actors, five
210
204
- **Not implemented:** Actor tasks, schedules, webhooks, and most of the API outside Actors, builds, runs, logs, and the three storage types. Unknown endpoints return `404` unless [fallback](#fall-back-to-the-apify-platform) is on.
211
205
- **Request queues:** locks do not expire, so `head/lock` hands a request out until an explicit unlock, reclaim, or runtime restart. Request deletion returns `501`. `GET /requests` lists only requests this runtime process has seen and ignores filters. Counts on the queue object are authoritative.
212
206
- **Storage metadata:** `hadMultipleClients` is always `false`, `stats` fields are zero, and dataset item options such as `fields` or `clean` apply after paging, so `total` counts unfiltered items.
213
-
- **Users:** any non-empty token is accepted. There is no real authentication, and the Console shows every user's objects.
207
+
- **Users:** any non-empty token is accepted. There is no real authentication.
214
208
- **One runtime per data directory.** Do not start two runtimes on the same `data` directory.
215
209
- **Operating systems:** Linux is tested. macOS works with the networking note in the [quick start](quick-start.md#start-with-docker). Windows with Docker Desktop and WSL 2 is untested.
216
210
217
211
## Next steps
218
212
219
-
- Read the exact behaviour in `requirements/api.md`, `requirements/actor-driver.md`, `requirements/storage.md`, and `requirements/console.md`.
213
+
- Read the exact behaviour in `requirements/api.md`, `requirements/actor-driver.md`, and `requirements/storage.md`.
220
214
- When your Actor works locally, unset the environment variables and `apify push` to deploy it to the Apify platform.
Copy file name to clipboardExpand all lines: docs/quick-start.md
+16-13Lines changed: 16 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ Add `-d` to run the container in the background. Stop it with `docker stop actor
52
52
53
53
**Docker Desktop on macOS**
54
54
55
-
On some Docker Desktop installations, `localhost:3333` and `localhost:3000` time out even though the runtime is healthy. The runtime joins a second Docker network, `apify-local`, so Actor containers can reach it, and Docker Desktop then routes replies through the wrong network. Start the container on that network directly so it has only one:
55
+
On some Docker Desktop installations, requests to the runtime's ports time out even though the runtime is healthy. The runtime joins a second Docker network, `apify-local`, so Actor containers can reach it, and Docker Desktop then routes replies through the wrong network. Start the container on that network directly so it has only one:
@@ -74,7 +74,7 @@ To verify that the runtime is up, run:
74
74
apify local status
75
75
```
76
76
77
-
The command reports the API at `http://localhost:3333`, the Console at `http://localhost:3000`, and the data directory, and exits non-zero when the runtime is down.
77
+
The command reports the runtime API URL, `http://localhost:3333`, and the data directory, and exits non-zero when the runtime is down.
78
78
79
79
**Proposed command**
80
80
@@ -84,7 +84,7 @@ The command reports the API at `http://localhost:3333`, the Console at `http://l
84
84
APIFY_CLIENT_BASE_URL=http://localhost:3333 apify api v2/users/me
85
85
```
86
86
87
-
It prints your user as JSON when the runtime is up, and a connection error when it is not. You can also open [http://localhost:3000](http://localhost:3000) in your browser.
87
+
It prints your user as JSON when the runtime is up, and a connection error when it is not.
88
88
89
89
## 2. Connect Apify CLI
90
90
@@ -141,19 +141,22 @@ Create one with [`apify create`](https://docs.apify.com/cli/docs/quick-start), o
141
141
142
142
## 4. View the results
143
143
144
-
Open [http://localhost:3000](http://localhost:3000) to browse the Actor, its builds and runs, logs, and the dataset, key-value store, and request queue the run produced.
144
+
To list the runs of your Actor, run:
145
145
146
-
You can also use the CLI:
146
+
```
147
+
apify runs ls
148
+
```
149
+
150
+
To read what a run produced, use the ids `apify call` printed:
| `apify datasets info <datasetId>` | Dataset metadata, including item count |
155
+
| `apify api v2/datasets/<datasetId>/items` | Dataset items |
156
+
| `apify api v2/key-value-stores/<storeId>/records/OUTPUT` | One key-value store record |
157
+
| `apify api v2/actor-runs/<runId>/log` | The run log |
155
158
156
-
`apify api` sends any request to the runtime API, so everything the Console shows is available this way. The raw files are in the `data` directory. Read them freely, but change state through the API.
159
+
`apify api` sends any request to the runtime API, so every Actor, build, run, log, and storage is available this way. The raw files are in the `data` directory. Read them freely, but change state through the API.
0 commit comments