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

If docker image is overridden in the project, it's not saved into .json #5108

Closed
humitos opened this issue Jan 15, 2019 · 6 comments
Closed
Labels
Bug A bug

Comments

@humitos
Copy link
Member

humitos commented Jan 15, 2019

Our PythonEnvironment.save_environment_json method has a bug.

When the Project.container_image is manually set by an admin, it's not used when saving the .json file into disk and it's used the default image instead.

The problem is at this line,

https://github.com/rtfd/readthedocs.org/blob/33ed2735dc6e5e6e3b9e552bbbb72df600648a4a/readthedocs/doc_builder/python_environments.py#L187

although, self.project.container_image is None at that point because I suppose the container_image field does not come with in the API call. We may want to add it when using an Admin user to hit this endpoint.

@humitos humitos added the Bug A bug label Jan 15, 2019
@stsewd
Copy link
Member

stsewd commented Jan 15, 2019

As explained here, we do that from the config module

#5109 (comment)

That solves the problem?

@stale
Copy link

stale bot commented Mar 1, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Mar 1, 2019
@humitos
Copy link
Member Author

humitos commented Mar 4, 2019

@stsewd did you tested that the json gets the proper value on it? It should match the image used to execute the commands to the one saved in the json file.

@stale stale bot removed the Status: stale Issue will be considered inactive soon label Mar 4, 2019
@stsewd
Copy link
Member

stsewd commented Mar 6, 2019

Yes, I just checked it

$ cat envs/latest/readthedocs-environment.json
{"python": {"version": 3.6}, "build": {"image": "readthedocs/build-dev:3.0", "hash": "sha256:64998dc2...."}}

Before it was building with the latest image.

@stsewd stsewd closed this as completed Mar 6, 2019
@humitos
Copy link
Member Author

humitos commented Mar 7, 2019

@stsewd so, your project was building with latest, then you set project.container_image = 'readthedocs/build-dev:3.0' and trigger the build again and that's the JSON that you are showing here?

@stsewd
Copy link
Member

stsewd commented Mar 7, 2019

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug
Projects
None yet
Development

No branches or pull requests

2 participants