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

Fix hanging #37 #53

Closed
wants to merge 3 commits into from
Closed

Fix hanging #37 #53

wants to merge 3 commits into from

Conversation

aGuttman
Copy link

Intended to fix #37 while using updated cloud approved server image. Messy, quick version of the solution. See issue comment for better solution outline.

Updated dependancies that were causing the conda solve to hang, as well as updating to a newer version of conda.

This is a messy workaround, the new dependency versions should really be changed in the server repo and a new image built that can be used from here.
Small output cleanup
Copy link
Contributor

@shankari shankari left a comment

Choose a reason for hiding this comment

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

Also add:

      - SERVER_REPO=https://github.com/aGuttman/e-mission-server.git
      - SERVER_BRANCH=dashboard-dependencies

to the notebook-server's environment section so you can rebuild with your server changes.

Please test with these changes and confirm that it works before I merge everything

viz_scripts/docker/Dockerfile Outdated Show resolved Hide resolved
viz_scripts/docker/Dockerfile Show resolved Hide resolved
@aGuttman
Copy link
Author

aGuttman commented Sep 7, 2022

Tested with emission/e-mission-server.dev.server-only:4.0.0 using updated dependancies from github.com/aGuttman/e-mission-server.git#dashboard-dependencies.

Works.

I'm unclear about what changes I should push. Asked to revert the emission/e-mission-server.dev.server-only:4.0.0 change after testing and remove to in-place dependency updates from the docker file. Should I assume that emission/e-mission-server:4.0.0 will have the updated dependancies and a working conda install?

@shankari
Copy link
Contributor

shankari commented Sep 7, 2022

@aGuttman can you write out the exact steps that you used for testing? This is complex, and I want to make sure that we actually tested what we wanted to.

wrt

Should I assume that emission/e-mission-server:4.0.0 will have the updated dependancies and a working conda install?

As you know from e-mission/e-mission-server#875, emission/e-mission-server:4.0.0 is a currently published image which will not have the updated dependencies.

You need to make the changes that I requested in e-mission/e-mission-server#875, we need to build a new image with the dependencies (should happen automatically when I merge e-mission/e-mission-server#876 after the CI is in place), and then bump up this version.

And we will need to bump up the dependencies here periodically to upgrade to the most recent server image version, which we will presumably do as part of the CI for this repo.

@aGuttman
Copy link
Author

aGuttman commented Sep 7, 2022

In Dockerfile:
Replaced FROM emission/e-mission-server:4.0.0 with FROM emission/e-mission-server.dev.server-only:4.0.0
Added clone github.com/aGuttman/e-mission-server.git and check out dashboard-dependencies (through env vars set in the docker-compose)
Removed in-place dependacy updates

RUN /bin/bash -c "cd e-mission-server && cat setup/export_versions.sh && printf \"export EXP_CONDA_VER=4.12.0\" > setup/export_versions.sh && cat setup/export_versions.sh"
RUN /bin/bash -c "cd e-mission-server && cat setup/environment36.notebook.additions.yml && printf \"name: emission\nchannels:\n- conda-forge\n- defaults\ndependencies:\n- branca=0.5.0\n- folium=0.12.1.post1\n- ipython=7.33.0\n- jedi=0.18.1\n- jupyter=1.0.0\n- matplotlib=3.5.1\n\" > setup/environment36.notebook.additions.yml && cat setup/environment36.notebook.additions.yml" 

Ran docker-compose -f docker-compose.dev.yml up:

RUN /bin/bash -c "cd e-mission-server && source setup/setup_conda.sh Linux-x86_64 && source setup/setup.sh"
RUN /bin/bash -c "cd e-mission-server && source setup/activate.sh && conda env update --name emission --file setup/environment36.notebook.additions.yml"
RUN /bin/bash -c "cd e-mission-server && source setup/activate.sh && conda env update --name emission --file /environment36.dashboard.additions.yml"

without an issue. (Requested to remove RUN /bin/bash -c "cd e-mission-server && source setup/setup_conda.sh Linux-x86_64 && source setup/setup.sh" above, but conda is not on emission/e-mission-server.dev.server-only:4.0.0, not sure I can do anything without running this line?)
Container starts up without errors.

@shankari
Copy link
Contributor

shankari commented Sep 7, 2022

Ran docker-compose -f docker-compose.dev.yml up:

you should also rebuild the docker-compose image. Otherwise, it will use the old image, right?
https://stackoverflow.com/a/39988980/4040267

The following builds the images if the images do not exist and starts the containers:

@aGuttman
Copy link
Author

aGuttman commented Sep 7, 2022

Ran docker-compose -f docker-compose.dev.yml up:

you should also rebuild the docker-compose image. Otherwise, it will use the old image, right? https://stackoverflow.com/a/39988980/4040267

The following builds the images if the images do not exist and starts the containers:

Correct, but I've been manually deleting the images. Forgot to mention that.

@shankari
Copy link
Contributor

shankari commented Sep 7, 2022

@aGuttman I can't actually merge this until you remove the hack
#53 (comment)

Also, do you have an ETA for addressing e-mission/e-mission-server#875?
If it is not today, please plan on committing the changes you made for the testing (so that this is not broken) and reverting them when you enable CI for this repo.

Remove in-place dependency update hack

Co-authored-by: shankari <shankari@eecs.berkeley.edu>
@aGuttman
Copy link
Author

aGuttman commented Sep 7, 2022

I will have addressed e-mission/e-mission-server/pull/875 today, yes, before 2:30 hopefully.

shankari added a commit to shankari/em-public-dashboard that referenced this pull request Sep 7, 2022
…ronments

In both:
- use the `dev-only` image and clone from Andrew's repo
    - this is the workaround for
      e-mission#53 until
      e-mission/e-mission-server#875 is merged

In the dev files:
- force a version for the http server
- build the viz_scripts image instead of using a pinned image
    - This subsumes e-mission#53
- Since the context is now `viz_scripts` and not `viz_scripts/docker` to
  maintain consistency with the prod server, change the paths to the various files

In the prod files:
- Remove the mounted code directories
- Change the dockerfiles to copy files into the image

Testing done: This builds, but DOES NOT WORK
Checking this in temporarily so that we can highlight the fix when we do get it to work

```
Building notebook-server
[+] Building 865.9s (20/20) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                         0.0s
 => => transferring dockerfile: 973B                                                                                                                                         0.0s
 => [internal] load .dockerignore                                                                                                                                            0.1s
 => => transferring context: 2B                                                                                                                                              0.0s
 => [internal] load metadata for docker.io/emission/e-mission-server.dev.server-only:4.0.0                                                                                   0.0s
 => CACHED [1/8] FROM docker.io/emission/e-mission-server.dev.server-only:4.0.0                                                                                              0.0s
 => [internal] load build context                                                                                                                                            0.1s
 => => transferring context: 112.46kB                                                                                                                                        0.0s
 => CACHED [ 2/15] ADD docker/environment36.dashboard.additions.yml /                                                                                                        0.0s
 => CACHED [ 3/15] RUN bash -c "/clone_server.sh"                                                                                                                            0.0s
 => CACHED [ 4/15] RUN /bin/bash -c "cd e-mission-server && source setup/activate.sh && conda env update --name emission --file setup/environment36.notebook.additions.yml"  0.0s
 => CACHED [ 5/15] RUN /bin/bash -c "cd e-mission-server && source setup/activate.sh && conda env update --name emission --file /environment36.dashboard.additions.yml"      0.0s
 => [ 6/15] RUN mkdir -p /usr/src/app/saved-notebooks                                                                                                                        0.4s
 => [ 7/15] WORKDIR /usr/src/app/saved-notebooks                                                                                                                             0.0s
 => [ 8/15] COPY auxiliary_files .                                                                                                                                           0.0s
 => [ 9/15] COPY bin .                                                                                                                                                       0.1s
 => [10/15] COPY conf .                                                                                                                                                      0.1s
 => [11/15] COPY *.ipynb .                                                                                                                                                   0.1s
 => [12/15] COPY *.py .                                                                                                                                                      0.1s
 => [13/15] ADD docker/start_notebook.sh /usr/src/app/start_notebook.sh                                                                                                      0.0s
 => [14/15] RUN chmod u+x /usr/src/app/start_notebook.sh                                                                                                                     0.5s
 => [15/15] ADD docker/crontab /usr/src/app/crontab                                                                                                                          0.1s
 => exporting to image                                                                                                                                                      35.9s
 => => exporting layers                                                                                                                                                     35.9s
 => => writing image sha256:61830a6f2563e657350d435c6c512f32f31c0c6e1cc13a9ad5a9bc3b57d66360                                                                                 0.0s
 => => naming to docker.io/em-pub-dash-prod/viz-scripts                                                                                                                      0.0s
Building dashboard
[+] Building 2.9s (10/10) FINISHED
```

```
notebook-server_1  | /usr/src/app/e-mission-server /usr/src/app/saved-notebooks
notebook-server_1  | DB host = db
notebook-server_1  | cp: cannot stat 'e-mission-server/conf/storage/db.conf': No such file or directory
notebook-server_1  | Web host = 0.0.0.0
notebook-server_1  | /usr/src/app/saved-notebooks
notebook-server_1  | cat: saved-notebooks/conf/storage/db.conf: No such file or directory
notebook-server_1  | /usr/src/app/start_notebook.sh: line 27: pushd: e-mission-server: No such file or directory
notebook-server_1  | /usr/src/app/start_notebook.sh: line 29: setup/setup.sh: No such file or directory
```
@shankari
Copy link
Contributor

shankari commented Sep 7, 2022

Subsumed by #54

@shankari shankari closed this Sep 8, 2022
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.

Hanging Line on Docker Build on Windows and OSX
2 participants