Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a procfile for background jobs #809

Merged
merged 2 commits into from
May 15, 2023
Merged

Add a procfile for background jobs #809

merged 2 commits into from
May 15, 2023

Conversation

jcoyne
Copy link
Contributor

@jcoyne jcoyne commented Apr 21, 2023

Fixes #643

@jcoyne jcoyne force-pushed the procfile branch 4 times, most recently from 1af3ec9 to a542f48 Compare April 25, 2023 21:13
@jcoyne jcoyne marked this pull request as ready for review May 8, 2023 18:34
@jcoyne jcoyne force-pushed the procfile branch 3 times, most recently from adbd91a to e7ec590 Compare May 8, 2023 21:04
README.md Outdated
Comment on lines 76 to 91
daemon processes run continuously. you can use `eye info` in an ssh session to view status information:
```sh
$ eye info

traject
workers
earthworks-stage-indexer_0 .... up (12:07, 0%, 73Mb, <1218016>)
folio_dev_indexer_0 ........... up (14:34, 6%, 137Mb, <1386323>)
marc_bodoni_dev_indexer_0 ..... up (12:07, 0%, 2731Mb, <1223573>)
marc_morison_dev_indexer_0 .... up (12:07, 0%, 1253Mb, <1223963>)
sw_dev_indexer_0 .............. up (12:07, 0%, 75Mb, <1224054>)
sw_dev_indexer_1 .............. up (12:07, 0%, 73Mb, <1224303>)
sw_preview_stage_indexer_0 .... up (12:07, 0%, 73Mb, <1224638>)
sw_preview_stage_indexer_1 .... up (12:07, 0%, 73Mb, <1224861>)
```
you can stop and start daemons with e.g. `eye stop sw_dev_indexer`. note that it may take some time for all the processes to start and stop. for more information on eye, use `eye help` or see the [eye wiki](https://github.com/kostya/eye/wiki).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we replace this with the equivalent systemd command to check service status? I imagine it's sudo systemctl status traject or something like that, but would be good to document. also copying the systemctl start/stop commands here would be nice

Copy link
Contributor Author

@jcoyne jcoyne May 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there really is an equivalency. systemctl status traject.target is only going to show:

sudo systemctl status traject.target
● traject.target
     Loaded: loaded (/lib/systemd/system/traject.target; enabled; vendor preset: enabled)
     Active: active since Mon 2023-05-08 14:02:26 PDT; 1 day 19h ago

May 08 14:02:26 sw-indexing-stage-a.stanford.edu systemd[1]: Reached target traject.target.

that isn't going to give any of the information that eye provided.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like list-dependencies will do this (sort of):

sudo systemctl list-dependencies traject.target
traject.target
● ├─traject-earthworks_stage_indexer.1.service
● ├─traject-folio_dev_indexer.1.service
● ├─traject-folio_dev_indexer.2.service
● ├─traject-folio_dev_indexer.3.service
● ├─traject-folio_dev_indexer.4.service
● ├─traject-folio_dev_indexer.5.service
● ├─traject-folio_dev_indexer.6.service
● ├─traject-folio_dev_indexer.7.service
● ├─traject-folio_dev_indexer.8.service
● ├─traject-marc_bodoni_dev_indexer.1.service
● ├─traject-marc_morison_dev_indexer.1.service
● ├─traject-sw_dev_indexer.1.service
● ├─traject-sw_dev_indexer.2.service
● ├─traject-sw_preview_stage_indexer.1.service
● └─traject-sw_preview_stage_indexer.2.service

at least you get the green dot for the ones that are running, which seems useful enough to document.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have sudo access to that. How do you?

sudo systemctl list-dependencies traject.target
[sudo] password for indexer:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just ksued first 🤷🏻

Copy link
Contributor Author

@jcoyne jcoyne May 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, well, then the sudo isn't going to do anything. Anyways, I made a PR to add sudo for that command in puppet. I didn't know about list-dependencies so thanks for brining that to my attention.

Comment on lines -35 to +56
2. a daemon run by [eye](https://github.com/kostya/eye) consumes data from the kafka topic and invokes traject
2. Systemd runs the various traject services
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't the services still do the same thing? i think it's useful to note that they are consuming data from kafka to send to traject

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It its traject itself that is acting as a kafka consumer. But the traject service it can have any input you configure it to have. Systemd knows nothing about kafka, so I didn't think that belongs here.

@jcoyne jcoyne merged commit cd170db into master May 15, 2023
@jcoyne jcoyne deleted the procfile branch May 15, 2023 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert eye-managed processes to use foreman instead
3 participants