Skip to content

Commit a7cd4a9

Browse files
committed
Improved job state tracking
1 parent ec8aeb7 commit a7cd4a9

File tree

8 files changed

+319
-142
lines changed

8 files changed

+319
-142
lines changed

deploy/docker-compose/customer1/docker-compose.override.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ services:
1111
- LOG_LEVEL=DEBUG
1212
- REPO_CONVERTER_INTERVAL_SECONDS=60
1313
- TRUNCATED_OUTPUT_MAX_LINES=40
14+
# It seems like the only way this works for both podman and docker compose,
15+
# is to run the container as UID=10001 and GID 10002,
16+
# both on the host,
17+
# and inside the container
1418
user: ${CURRENT_UID_GID}
1519
volumes:
1620
- ../../../src-serve-root/:/sg/src-serve-root

dev/TODO.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,24 @@
2424
- See Slack thread with Eng
2525
- Amped the `dev/query_logs.py` script in the meantime
2626

27-
- Build up log event context, ex. canonical logs, and be able to retrieve this context in cmd.log_process_status()
27+
- Build up log event context, ex. canonical logs
28+
- And be able to retrieve this context in cmd.log_process_status()
2829

2930
- Enhance error events with automatic error context capture and correlation IDs
3031
- Remote server response errors, ex. svn: E175012: Connection timed out
3132
- Decorators and context managers for logging context?
3233

3334
- Log a repo status event at the end of the svn.py module
34-
- Status (up to date / out of date)
35+
- Remote
36+
- SVN
37+
- Revs remaining to convert
38+
- Total rev count
39+
- Local
40+
- Git
41+
- Last rev from git log at start
42+
- Last rev from git log at end
3543
- Last run's status (success / fail)
3644
- Progress (% of revs converted)
37-
- Revs converted
38-
- Revs remaining
39-
- Total revs
4045

4146
- Amp's suggestion
4247
- Context Managers: Git operations and command execution use context managers to automatically inject relevant metadata for all logs within their scope.
@@ -52,9 +57,9 @@
5257
- `svn log` commands
5358
- Longest commands, which seem to be timing out and causing issues
5459
- What do we use them for? Why?
55-
- The big one: Count all revs remaining to convert, as a progress indicator
56-
- The small one: Get first and last rev numbers to start and end this batch
57-
- The smallest one: Log recent commits, to visually verify a successful fetch
60+
- The big one: Count all revs remaining to convert, as a progress indicator - Disabled this by default
61+
- The small one: Get first and last rev numbers to start and end this batch - Seems to be necessary, but combined into one, and limited to batch size
62+
- The smallest one: Log recent commits, to visually verify a successful fetch - Disabled by default
5863
- We may be able to make the conversion process much smoother if we can use fewer of these log commands
5964
- Keep the output revision numbers from `git svn log --xml` commands in a file on disk
6065
- Append to this file when there are new revisions, so getting counts of revisions in each repo is slow once, fast many times
@@ -168,8 +173,10 @@
168173
## Processes
169174

170175
- How do I get more information about the child PID which was reaped in these lines, in `./src/utils/signal_handler.py`?
176+
171177
```python
172178
if os.WIFEXITED(status) and os.WEXITSTATUS(status) != 0:
179+
# "message": "SIGCHLD handler reaped child PID 10747 with exit code 129",
173180
log(ctx, f"SIGCHLD handler reaped child PID {pid} with exit code {os.WEXITSTATUS(status)}", "warning")
174181
```
175182
- Maintain a list of processes, with their metadata, from when they're launched, and updated on an interval, then look up that information in the signal handler
@@ -220,8 +227,11 @@
220227
- gha-env-vars-workflow-dispatch.sh
221228
- Wolfi Python base image for Docker / podman build
222229
- Container runAs user
223-
- src serve-git and repo-converter both run as root, which is not ideal
224-
- Need to create a new user on the host, add it to the host's sourcegraph group, get the UID, and configure the runAs user for the containers with this UID
230+
- It seems like the only way this works for both Podman and Docker Compose, is to:
231+
- Bake the image with a specific UID/GID,
232+
- and change the app service user account's UID/GID on the host OS to match
233+
- Changed the UID of the service account on the host to 10001, and GID to 10002
234+
- I hope I'm wrong on this limitation, adding this to the TODO list to figure out later
225235
226236
## Dev
227237

0 commit comments

Comments
 (0)