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

Alternative way to check if running in Docker #1204

Merged
merged 19 commits into from
Dec 3, 2022

Conversation

gaborschulz
Copy link
Contributor

@gaborschulz gaborschulz commented Dec 2, 2022

Description

The running_in_docker function can lead to unpredictable results, in certain cases it does not recognize that it's running inside docker and leads to the version check being in place. This produces errors in build pipelines.

GitHub Issues

#1140
#1201

@gaborschulz gaborschulz changed the title Zappa 1140 Alternative way to check if running in Docker Dec 2, 2022
@coveralls
Copy link

coveralls commented Dec 2, 2022

Coverage Status

Coverage decreased (-0.007%) to 74.547% when pulling bc7427c on gaborschulz:zappa-1140 into ea55be9 on zappa:master.

zappa/__init__.py Outdated Show resolved Hide resolved
zappa/__init__.py Show resolved Hide resolved
@monkut
Copy link
Collaborator

monkut commented Dec 2, 2022

If the current check is unstable/unreliable, using a environment variable is much cleaner!
Thanks!

zappa/__init__.py Outdated Show resolved Hide resolved
@monkut
Copy link
Collaborator

monkut commented Dec 2, 2022

Can you pull in the CHANGLOG and version updates in this PR?
#1203

Since this is an open issue, I want to get this fix released asap.

CHANGELOG.md Show resolved Hide resolved
@monkut
Copy link
Collaborator

monkut commented Dec 3, 2022

@gaborschulz can you check the lint results and run make black, make isort to fix formatting issues?

Copy link
Contributor Author

@gaborschulz gaborschulz left a comment

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

@monkut monkut left a comment

Choose a reason for hiding this comment

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

one minor change request

zappa/__init__.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@goya813 goya813 left a comment

Choose a reason for hiding this comment

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

LGTM!
The test now passes in my Mac Book environment!

@monkut monkut merged commit 73ee393 into zappa:master Dec 3, 2022
Ian288 pushed a commit to tackle-io/Zappa that referenced this pull request Jul 11, 2023
* Update setup.py

* Update __init__.py

* 🐛 fix FileNotFoundError in running_in_docker (zappa#1201)

* Remove version constraints

* Changed the way Docker is determined

* Reference to ticket 1140

* Added documentation for ZAPPA_RUNNING_IN_DOCKER flag

* Fixed indentation

* Removed log file

* Added strtobool and re-added MINIMUM_SUPPORTED_MIINOR_VERSION

* updated version

* Added zappa#1201 to CHANGELOG.md, reformatted code

* Reformatted by black due to line length

* Removed unnecessary comment

Co-authored-by: monkut <shane.cousins@gmail.com>
BarNehemia added a commit to Lightricks/Zappa that referenced this pull request Aug 10, 2023
…zappa-0.57.0

* commit '0b1eab14ca39c3a3bfb4e915347e07495171dcba': (27 commits)
  updating workflow actions to remove deprecation warnings (zappa#1243)
  📝 CHANGELOG.md update for 0.57.0 (zappa#1246)
  fixing compatibility with Django 4.2 (zappa#1237)
  Update Readme with patreon and donors (zappa#1234)
  adding support for Python 3.10 (zappa#1231)
  Nose to pytest (zappa#1239)
  lint: updating code style with `make black` (zappa#1238)
  Alternative way to check if running in Docker (zappa#1204)
  📝 CHANGELOG.md update for 0.56.0 release (zappa#1187)
  Improve `get_best_match_zone()` to match by most matched components instead of by length of domain (zappa#1193)
  Bypass python version runtime check when code run in docker (zappa#1180)
  Be able to pass in a batch window when using batch size (zappa#1118)
  Correction to README. (zappa#1177)
  (zappa#908) Update BINARY_SUPPORT to use Content-Encoding to identify if data is binary (zappa#1155)
  Remove special check for Django<1.7, fix for zappa#1158  (zappa#1159)
  Resolve (zappa#410) Logs are missing query strings (zappa#1165)
  Handle spaces in x-forwared-for/remove six (zappa#1127) (zappa#1163)
  add feature (zappa#704) Check if args/kwargs are JSON Serializable while running locally (zappa#1154)
  docs: Add documentation for s3 event object key_filters (zappa#1169)
  Add feature pyenv virtualenv detecting .python-version file (zappa#1153)
  ...

# Conflicts:
#	zappa/cli.py
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.

4 participants