Docker 里使用终端修改后,如何选择保存的 Container ID?
发布于 3 个月前 作者 asterocean 169 次浏览 来自 问答

您使用的QUANTAXIS版本号是什么?

1.10.12

您的系统信息(包括系统版本,系统架构(32/64),内存大小等等)

  • Model Identifier: MacBookPro11,3
  • Processor Name: Quad-Core Intel Core i7
  • Processor Speed: 2.5 GHz
  • Memory: 16 GB

您的系统环境是什么?

- monodb  MongoDB shell version v4.2.3
- python3.7/3.8  Python 3.8.5
- docker(有无)  有

您需要反馈的问题

发现在 Jupiterlab 终端或者 在 Docker Cli 环境里执行了更改后,重新启动 Docker ,更改丢失。 查了资料,需要执行 docker ps 和 docker commit 命令, 问题是 docker ps 返回 5 个 Container,应该 commit 哪个 container ?

CONTAINER ID   IMAGE                                                      COMMAND                  CREATED        STATUS       PORTS                                                                                                                                                                                                           NAMES
c7e7cc1bff82   daocloud.io/quantaxis/qacommunity-rust-go:allin-20210218   "/root/wait_for_it.s…"   24 hours ago   Up 4 hours   0.0.0.0:8010->8010/tcp, :::8010->8010/tcp, 80/tcp, 0.0.0.0:8018-8019->8018-8019/tcp, :::8018-8019->8018-8019/tcp, 8020/tcp, 8787/tcp, 8888/tcp, 0.0.0.0:8028-8029->8028-8029/tcp, :::8028-8029->8028-8029/tcp   qaweb
dfaec4f496b9   daocloud.io/quantaxis/qacommunity-rust-go:allin-20210218   "/bin/bash /root/run…"   24 hours ago   Up 4 hours   8010/tcp, 8018-8020/tcp, 0.0.0.0:8787->8787/tcp, :::8787->8787/tcp, 8028-8029/tcp, 0.0.0.0:8888->8888/tcp, :::8888->8888/tcp, 0.0.0.0:81->80/tcp, :::81->80/tcp                                                 qacommunity-rust
7f14502d9f36   daocloud.io/quantaxis/qatrader:latest                      "/root/QATrader/dock…"   24 hours ago   Up 4 hours   8010/tcp, 0.0.0.0:8020->8020/tcp, :::8020->8020/tcp                                                                                                                                                             goldfuture_qatrader_1
02d3f0b5c4f5   daocloud.io/quantaxis/qaeventmq:latest                     "docker-entrypoint.s…"   24 hours ago   Up 4 hours   0.0.0.0:4369->4369/tcp, :::4369->4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, :::5672->5672/tcp, 15671/tcp, 15691-15692/tcp, 0.0.0.0:15672->15672/tcp, :::15672->15672/tcp, 25672/tcp                            goldfuture_qaeventmq_1
d440ea024972   daocloud.io/quantaxis/qamongo_single:latest                "docker-entrypoint.s…"   24 hours ago   Up 4 hours   0.0.0.0:27017->27017/tcp, :::27017->27017/tcp                                                                                                                                                                   goldfuture_mgdb_1

我想保存的更改是

  1. pip install quantaxis -U, 这个版本升级到 1.10.19
  2. apt install vim 增加编辑器,用以修改 crontab 实现自动更新 请问建议使用哪个 container id ?

另外的两个问题是:

  1. save future_list 和 save future_day 报错,提示
(base) root@c7e7cc1bff82:~# quantaxis
jqdatasdk not installed
you are using non-interactive mdoel quantaxis
QUANTAXIS> save future_list
QUANTAXIS>> Selecting the Best Server IP of TDX
USING DEFAULT STOCK IP
USING DEFAULT FUTURE IP
QUANTAXIS>> === The BEST SERVER ===
 stock_ip 123.125.108.24 future_ip 119.97.185.5
❌命令格式不正确!
Usage: 
            命令格式:save all  : save stock_day/xdxr/ index_day/ stock_list/index_list 

这个没有找到任何头绪

2、save stock_block 报错,提示

QUANTAXIS> save stock_block
QUANTAXIS>> ##JOB09 Now Saving STOCK_BlOCK ====
QUANTAXIS>> tdx Block ====
HTTP Error 403: Forbidden
QUANTAXIS>> 'NoneType' object has no attribute 'columns'
 Error save_tdx.QA_SU_save_stock_block exception!

查了资料,有说是 tdx 网络问题,但一直未见好转

您的联系方式(QQ/EMAIL)

QQ:43909589

1 回复

自问自答,作为参考吧 不知道什么原因,用 JupiterLab 的终端做的更改,并没有随着系统重启而丢失。系统已升级到 1.10.19 这个问题本身是个乌龙。

save future_day 和 save future_list 报错的原因是 QACmd/init.py 里没有对 save future_day 和 future_list 的处理语句(很奇怪的事情)。然而在增加了以下语句:

            elif len(arg) == 1 and arg[0] == "future_list":
                QA_SU_save_future_list("tdx")
            elif len(arg) == 1 and arg[0] == "future_day":
                QA_SU_save_future_day("tdx")

后,运行 save future_list ,仍然报错。

QUANTAXIS> save future_list
QUANTAXIS>> Selecting the Best Server IP of TDX
USING DEFAULT STOCK IP
USING DEFAULT FUTURE IP
QUANTAXIS>> === The BEST SERVER ===
 stock_ip 123.125.108.24 future_ip 59.175.238.38
Traceback (most recent call last):
  File "/opt/conda/bin/quantaxis", line 8, in <module>
    sys.exit(QA_cmd())
  File "/opt/conda/lib/python3.8/site-packages/QUANTAXIS/QACmd/__init__.py", line 738, in QA_cmd
    cli.cmdloop()
  File "/opt/conda/lib/python3.8/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "/opt/conda/lib/python3.8/cmd.py", line 217, in onecmd
    return func(arg)
  File "/opt/conda/lib/python3.8/site-packages/QUANTAXIS/QACmd/__init__.py", line 607, in do_save
    QA_SU_save_future_list("tdx")
  File "/opt/conda/lib/python3.8/site-packages/QUANTAXIS/QASU/main.py", line 123, in QA_SU_save_future_list
    engine.QA_SU_save_future_list(client=client)
  File "/opt/conda/lib/python3.8/site-packages/QUANTAXIS/QASU/save_tdx.py", line 5778, in QA_SU_save_future_list
    future_list = QA_fetch_get_future_list()
  File "/opt/conda/lib/python3.8/site-packages/QUANTAXIS/QAFetch/QATdx.py", line 1539, in QA_fetch_get_future_list
    extension_market_list = QA_fetch_get_extensionmarket_list(
  File "/opt/conda/lib/python3.8/site-packages/QUANTAXIS/QAFetch/QATdx.py", line 1516, in QA_fetch_get_extensionmarket_list
    return pd.concat([apix.to_df(
  File "/opt/conda/lib/python3.8/site-packages/pandas/util/_decorators.py", line 311, in wrapper
    return func(*args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/pandas/core/frame.py", line 5446, in set_index
    raise KeyError(f"None of {missing} are in the columns")
KeyError: "None of ['code'] are in the columns"

save stock_block 的报错,原因不明,可能是被服务器屏蔽了。

回到顶部