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

Run cron jobs in Docker #4387

Merged
merged 6 commits into from Feb 12, 2021
Merged

Run cron jobs in Docker #4387

merged 6 commits into from Feb 12, 2021

Conversation

cclauss
Copy link
Collaborator

@cclauss cclauss commented Jan 8, 2021

Blocked by: internetarchive/olsystem#110
Closes #4383, #4542
Subtask of #4060

We are running on an oldev-based node but we want to run the cronjobs that are in /olsystem/etc/cron.d.

What about Caution on the double run?

https://stackoverflow.com/questions/37458287/how-to-run-a-cron-job-inside-a-docker-container

Technical

Testing

Screenshot

Stakeholders

@cclauss cclauss added Affects: Admin/Maintenance Issues relating to support scripts, bots, cron jobs and admin web pages. [managed] Module: Docker Issues related to the configuration or use of Docker. [managed] labels Jan 8, 2021
@cclauss cclauss added this to the Active Sprint milestone Jan 8, 2021
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
@cclauss cclauss added the Priority: 2 Important, as time permits. [managed] label Jan 21, 2021
@cclauss cclauss added this to In progress in Python3 Jan 21, 2021
@cclauss cclauss moved this from In progress to In review in Python3 Jan 22, 2021
@cclauss cclauss marked this pull request as ready for review January 22, 2021 10:23
@cclauss cclauss changed the title DRAFT: Run cron jobs in Docker Run cron jobs in Docker Jan 22, 2021
@cclauss cclauss added Priority: 1 Do this week, receiving emails, time sensitive, . [managed] and removed Priority: 2 Important, as time permits. [managed] labels Jan 26, 2021
@cclauss
Copy link
Collaborator Author

cclauss commented Jan 28, 2021

Add ia_db_pw_file for 5 * * * * python $SCRIPTS/openlibrary-server /olsystem/etc/openlibrary.yml runmain openlibrary.solr.process_stats --load-from-db > /var/log/openlibrary/loanstats.log 2>&1

And python $SCRIPTS/manage-imports.py --config /olsystem/etc/openlibrary.yml add-new-scans

@cclauss
Copy link
Collaborator Author

cclauss commented Feb 5, 2021

Added the solrwriter change where both strip_bad_char() and unicodedata.normalize() expect value to be a str.

@cclauss
Copy link
Collaborator Author

cclauss commented Feb 5, 2021

<html>

<head>
    <title>Apache Tomcat/6.0.39 - Error report</title>
    <style>
        <!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}
        -->
    </style>
</head>

<body>
    <h1>HTTP Status 400 - ERROR: [doc=loans/loan-1944635007] Error adding field
        \'duration_hours_i\'=\'0.0008333333333333334\'</h1>
    <HR size="1" noshade="noshade">
    <p><b>type</b> Status report</p>
    <p><b>message</b> <u>ERROR: [doc=loans/loan-1944635007] Error adding field
            \'duration_hours_i\'=\'0.0008333333333333334\'</u></p>
    <p><b>description</b> <u>The request sent by the client was syntactically incorrect.</u></p>
    <HR size="1" noshade="noshade">
    <h3>Apache Tomcat/6.0.39</h3>
</body>

</html>

Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

Lgtm! One last change: Can you update our deploy script to make sure it starts this service?

@cclauss
Copy link
Collaborator Author

cclauss commented Feb 11, 2021

I made that change on #4457 but that is still not landed.

Copy link
Member

@mekarpeles mekarpeles left a comment

Choose a reason for hiding this comment

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

lgtm

@mekarpeles
Copy link
Member

I see restart always on the cron and #4457 has landed, going to merge this as well.

@mekarpeles mekarpeles merged commit b6aad1e into internetarchive:master Feb 12, 2021
@mekarpeles mekarpeles assigned mekarpeles and unassigned cdrini Feb 12, 2021
@cclauss cclauss deleted the run-cron-jobs-in-Docker branch February 12, 2021 11:27
@cdrini cdrini assigned cdrini and unassigned mekarpeles Feb 12, 2021
@cclauss cclauss moved this from In review to Done in Python3 Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Affects: Admin/Maintenance Issues relating to support scripts, bots, cron jobs and admin web pages. [managed] Module: Docker Issues related to the configuration or use of Docker. [managed] Priority: 1 Do this week, receiving emails, time sensitive, . [managed]
Projects
No open projects
Python3
  
Done
Development

Successfully merging this pull request may close these issues.

Create cron jobs docker-compose service
3 participants