hackforla / website

Hack for LA's website
https://www.hackforla.org
GNU General Public License v2.0
324 stars 766 forks source link

Keep local Docker images up to date #3488

Open ericvennemeyer opened 2 years ago

ericvennemeyer commented 2 years ago

Dependency

Overview

As a member of the website development team, I want to make sure my local Docker environment always matches the GitHub Pages environment. This issue is to create a procedure for developers to periodically update their local Docker images.

Action Items

Resources/Instructions

Notes on local Docker images

Although the Docker image the website team uses (hackforlaops/ghpages) is updated every time GitHub Pages updates its software dependencies, the newly-updated image is not automatically downloaded to a developer's local computer every time they run docker compose up. Instead, Docker will look to see if the image already exists locally and, if it does, will continue to use that version. This may mean that whichever version of the image existed when a developer first ran Docker is the one they are still using, even if new versions have since been published.

The most straightforward way of addressing this is for developers to periodically remove their local copy of the image, either via command line or through the Docker Dashboard GUI, before running docker compose up. This will force Docker to automatically download the latest version from Docker Hub.

A possible solution would be to make removing the image a new step in another workflow that developers regularly use, such as creating a local feature branch to work on an issue, or updating their local gh-pages before pushing a finished issue to their forked repo.

github-actions[bot] commented 2 years ago

Hi @ericvennemeyer.

Please don't forget to add the proper labels to this issue. Currently, the labels for the following are missing: Size, Role, Feature

NOTE: Please ignore the adding proper labels comment if you do not have 'write' access to this directory.

To add a label, take a look at Github's documentation here.

Also, don't forget to remove the "missing labels" afterwards. To remove a label, the process is similar to adding a label, but you select a currently added label to remove it.

After the proper labels are added, the merge team will review the issue and add a "Ready for Milestone" label once it is ready for prioritization.

Additional Resources:

JessicaLucindaCheng commented 1 year ago

To dev leads: Are any of the devs up to speed and know what this issue is about? If no devs are, then is there a strong backend developer that can get up to speed on the issue and then meet up with Bonnie and Eric to get up to speed on the next steps, and get a hand off from Eric?

blulady commented 1 year ago

To dev leads: Are any of the devs up to speed and know what this issue is about? If no devs are, then is there a strong backend developer that can get up to speed on the issue and then meet up with Bonnie and Eric to get up to speed on the next steps, and get a hand off from Eric?

I am familiar with the issue. I think having the extra step in the work flows is good for familiarizing the developers with simple docker commands as well as being a simple solution to this problem. @JessicaLucindaCheng is there a particular reason a meeting is necessary?

JessicaLucindaCheng commented 1 year ago

To dev leads: Are any of the devs up to speed and know what this issue is about? If no devs are, then is there a strong backend developer that can get up to speed on the issue and then meet up with Bonnie and Eric to get up to speed on the next steps, and get a hand off from Eric?

I am familiar with the issue. I think having the extra step in the work flows is good for familiarizing the developers with simple docker commands as well as being a simple solution to this problem. @JessicaLucindaCheng is there a particular reason a meeting is necessary?

We discussed this at the 2022-11-14 Dev/PM meeting. Here are the notes copied from the meeting:

blulady commented 1 year ago

@JessicaLucindaCheng @ExperimentsInHonesty Hey guys, there was a link that you showed me at that meeting to a glitching Docker Image. Before arranging this meeting, can someone link the faulty Docker Image? Thanks!!!

ExperimentsInHonesty commented 1 year ago

I don't know where to find that. All the links I knew about I provided above.

there was a link that you showed me at that meeting to a glitching Docker Image. Before arranging this meeting, can someone link the faulty Docker Image?

I added a milestone, but not sure if this is ready to come out of draft yet so I am leaving it in the new issue approval until you add the ready for milestone label again with instructions that we are ready.

blulady commented 1 year ago

I don't know where to find that. All the links I knew about I provided above.

there was a link that you showed me at that meeting to a glitching Docker Image. Before arranging this meeting, can someone link the faulty Docker Image?

I added a milestone, but not sure if this is ready to come out of draft yet so I am leaving it in the new issue approval until you add the ready for milestone label again with instructions that we are ready.

I think this is the image (although it seems to be working now) you showed me when we discussed why a meeting with Eric was necessary. Although it seems to be working now. I am still confused, would you like me to set up a meeting for you and Eric like we discussed at the 22-11-14 Meeting or just make the issue?

jdingeman commented 1 year ago

I am not sure, but I think this issue should have been fixed with an automatic process every time a dev runs Docker. Here is the PR that added jekyll clean to the docker-compose.yml so that Docker rebuilds every file.

ExperimentsInHonesty commented 1 year ago

@jdingeman do you want to reach out to @ericvennemeyer via slack and if not slack via email? to confirm that this resolves the problem? If you are satisfied that we don't need to reach out to him, then go ahead and close it.

github-actions[bot] commented 1 year ago

Hi @jdingeman, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:- i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?) ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

jdingeman commented 1 year ago

@ExperimentsInHonesty - attempted Slack last week, no luck. I will try to email him today.

jdingeman commented 1 year ago

@ExperimentsInHonesty - here is what Eric said

The quick answer is no, I don't think #3741 fixes #3488. I'm not an expert in Jekyll (or Docker, for that matter :grimacing:) but it looks like jekyll clean only affects the website files, not the Docker container the website is being served within. This might not really matter, though. To give a little context, when I was creating that Docker image, I realized that people who'd been on the Website team for a while might inadvertently be using old versions of the image when starting up a Docker container on their personal computers. This is because Docker will look through the docker-compose.yml file the first time you ever run docker compose up and see which image it's supposed to be using. If that image doesn't already exist on your hard drive, it will go to Docker Hub and download it from there. But, if you DO already have that image on your hard drive, Docker will just use it even if there's a more recent version on Docker Hub. There are two reasons this might not be a big deal: The HFLA Docker image only needs to be updated when GitHub Pages is updated, and that doesn't seem to happen too often. When it does, the changes don't seem to be major. (At least in the handful of months when I was paying attention to it.) I remember there being a lot of turnover on the website team, so in practice it's likely that most people are only using the first Docker image they download for a few months before moving on to a different team or leaving HFLA altogether.

So I think it may still be worth having this issue worked on.

github-actions[bot] commented 1 year ago

@jdingeman

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, May 9, 2023 at 12:15 AM PST.

ExperimentsInHonesty commented 1 year ago

@jdingeman I agree. So what are next steps?

ExperimentsInHonesty commented 1 year ago

@jdingeman When you get time, if you could identify next steps on this issue, someone else from the merge team could make up the issues. Or if you think this can wait, we can let it sit until you get back.

github-actions[bot] commented 1 year ago

@jdingeman

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, May 16, 2023 at 12:16 AM PST.

github-actions[bot] commented 1 year ago

@jdingeman

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, May 23, 2023 at 12:17 AM PST.

github-actions[bot] commented 1 year ago

@jdingeman

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, May 30, 2023 at 12:15 AM PST.

github-actions[bot] commented 1 year ago

@jdingeman

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, June 6, 2023 at 12:16 AM PST.

github-actions[bot] commented 1 year ago

@jdingeman

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, June 13, 2023 at 12:16 AM PST.

ExperimentsInHonesty commented 9 months ago

@roslynwythe I moved this into the new issue review column because the dependency is resolved. Please add a ready for prioritization label if its ready.

HackforLABot commented 1 month ago

Hi @roslynwythe, HfLA appreciates your interest in this issue, but please note that it is in the "New Issue Approval" column of the Project Board because it has not been finalized, approved, or prioritized, and so it is not ready for assignment. For this reason, you have been unassigned from this issue. Please remember to assign issues only from the "Prioritized Backlog" column.

The only exceptions to this rule are if you are writing an issue and the Draft label is applied, or if you are self-assigning to your "Pre-work Checklist" (the issue includes the Complexity: Prework label).

roslynwythe commented 1 month ago

I recommend that when an updated image hackforlaops/ghpages is available on Dockerhub, we notify developers via Slack and at meetings. I suggest these instructions:

image

HackforLABot commented 1 month ago

Hi @roslynwythe, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:- i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?) ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

roslynwythe commented 1 month ago

Pulling a new image and rebuilding the container is time consuming so I would rather avoid doing that needlessly. There are some ways to automate this so that the docker client will check to see if a more recent version of an image is available.
In https://stackoverflow.com/questions/47326900/check-for-newer-docker-build-for-image?rq=3 Two methods are proposed: 1) a project called Watchtower (https://github.com/v2tec/watchtower), which watches the running container and if there is a new version with the same tag available, it will pull the new image and restart the container. 2) scripting within docker-compose.yml (that invokes a python script) to detect if the local docker image is out of date, but I'm not sure that is feasible as it requires python.

I might not have time for analysis of the above so please advise, should I modify the Action Items and unassign?

ExperimentsInHonesty commented 1 month ago

@roslynwythe will figure out what kind of check that people writing code for an issue, reviewing or submitting PRs could do, that would tell them if they have the most current docker image https://hub.docker.com/r/hackforlaops/ghpages

If there is an easy way to tell, then we write something for contributing on how to check and then how to update if needed.

roslynwythe commented 1 month ago

Draft: Proposed changes to CONTRIBUTING.md Section 2.7.b

roslynwythe commented 2 weeks ago