Unable to start docker container


Daylend

Recommended Posts

Hi!

 

I decided it would be a fun project to turn a python script I made into a docker container, so I could deploy it on my unraid server to run 24/7. I managed to get the script running flawlessly in a docker image I built on my local machine from my dockerhub repo (literally copy pasted the command from unraid). However, after I successfully install the container in unraid, it immediately stops with no docker logs.

 

Any ideas what could be causing an issue like this?

firefox_LMtAnT3gfQ.png

firefox_BMtPYW8joN.png

Link to comment

You can run it from Unraid's commandline to get logs.

 

Here's what I got after running your container image:

Docker command I used: docker run -ti --rm -e clientid=test -e clientsecret=test -e username=test -e password=test daylend/redditcnn

 

docker run -ti --rm -e clientid=test -e clientsecret=test -e username=test -e password=test daylend/redditcnn                                                                      Using TensorFlow backend.
/usr/local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/usr/local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/usr/local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/usr/local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/usr/local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/usr/local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
/usr/local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/usr/local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/usr/local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/usr/local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/usr/local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/usr/local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
WARNING:tensorflow:From ./redditCNN_runnable.py:42: The name tf.GPUOptions is deprecated. Please use tf.compat.v1.GPUOptions instead.

WARNING:tensorflow:From ./redditCNN_runnable.py:43: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

WARNING:tensorflow:From ./redditCNN_runnable.py:44: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

2019-09-07 18:50:37.965517: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-09-07 18:50:37.968748: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3192000000 Hz
2019-09-07 18:50:37.969189: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x559bef573580 executing computations on platform Host. Devices:
2019-09-07 18:50:37.969204: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
WARNING:tensorflow:From /usr/local/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:541: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

WARNING:tensorflow:From /usr/local/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:4432: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

WARNING:tensorflow:From /usr/local/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:4267: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

2019-09-07 18:50:38.007169: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
WARNING:tensorflow:From /usr/local/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:2041: The name tf.nn.fused_batch_norm is deprecated. Please use tf.compat.v1.nn.fused_batch_norm instead.

WARNING:tensorflow:From /usr/local/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3733: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
Checking Reddit now
Traceback (most recent call last):
  File "./redditCNN_runnable.py", line 75, in <module>
    for submission in subreddit.stream.submissions():
  File "/usr/local/lib/python3.7/site-packages/praw/models/util.py", line 182, in stream_generator
    **function_kwargs
  File "/usr/local/lib/python3.7/site-packages/praw/models/listing/generator.py", line 52, in __next__
    self._next_batch()
  File "/usr/local/lib/python3.7/site-packages/praw/models/listing/generator.py", line 62, in _next_batch
    self._listing = self._reddit.get(self.url, params=self.params)
  File "/usr/local/lib/python3.7/site-packages/praw/reddit.py", line 442, in get
    data = self.request("GET", path, params=params)
  File "/usr/local/lib/python3.7/site-packages/praw/reddit.py", line 577, in request
    method, path, data=data, files=files, params=params
  File "/usr/local/lib/python3.7/site-packages/prawcore/sessions.py", line 185, in request
    params=params, url=url)
  File "/usr/local/lib/python3.7/site-packages/prawcore/sessions.py", line 116, in _request_with_retries
    data, files, json, method, params, retries, url)
  File "/usr/local/lib/python3.7/site-packages/prawcore/sessions.py", line 101, in _make_request
    params=params)
  File "/usr/local/lib/python3.7/site-packages/prawcore/rate_limit.py", line 35, in call
    kwargs['headers'] = set_header_callback()
  File "/usr/local/lib/python3.7/site-packages/prawcore/sessions.py", line 145, in _set_header_callback
    self._authorizer.refresh()
  File "/usr/local/lib/python3.7/site-packages/prawcore/auth.py", line 328, in refresh
    password=self._password)
  File "/usr/local/lib/python3.7/site-packages/prawcore/auth.py", line 138, in _request_token
    response = self._authenticator._post(url, **data)
  File "/usr/local/lib/python3.7/site-packages/prawcore/auth.py", line 31, in _post
    raise ResponseException(response)
prawcore.exceptions.ResponseException: received 401 HTTP response

 

Link to comment

Interesting, what you got is how it's supposed to work with invalid credentials. And it's what I get on my local machine as well, which is good. When I try to run it on my unraid server, I get the following:
 

Linux 4.19.56-Unraid.
root@Tower:~# docker run -ti --rm -e clientid=test -e clientsecret=test -e username=test -e password=test daylend/redditcnn
Using TensorFlow backend.
root@Tower:~# 

 

Link to comment
15 minutes ago, Daylend said:

Interesting, what you got is how it's supposed to work with invalid credentials. And it's what I get on my local machine as well, which is good. When I try to run it on my unraid server, I get the following:
 


Linux 4.19.56-Unraid.
root@Tower:~# docker run -ti --rm -e clientid=test -e clientsecret=test -e username=test -e password=test daylend/redditcnn
Using TensorFlow backend.
root@Tower:~# 

 

Tough one.  My first guess is network access from the container? Maybe try it with --net=host

docker run -ti --rm --net=host -e.....

 

Link to comment
1 hour ago, Daylend said:

Same problem unfortunately. I tried to change the tensorflow config, figured maybe it was a problem with the script, but no luck.

:(

darn, not sure why, I didn't do anything special just SSH into Unraid and paste in the command.

 

Even though I can't help with that problem, if you get that working you could shrink your docker image size depending on the App's requirements.

FROM alpine:3.10
RUN apk add --no-cache python3
ADD redditCNN_runnable.py /
ADD model.json /
ADD weights.h5 /

# package installer if you need more dependant softare for your app
#RUN apk add --no-cache bash nodejs shadow #etc #etc

RUN pip3 install --no-cache-dir pillow praw requests tensorflow keras numpy

ENV clientid=id \
    clientsecret=secret \
    username=username \
    password=password

CMD python3 redditCNN_runnable.py

 

Edited by dee31797
  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.