我正在尝试使用 Airflow 和 Postgres 构建一个 docker 容器,但在构建过程中出现了许多错误,如下所示。我尝试过降级,markupsafe如下requirements.txt所示,但没有帮助。我可以做什么来解决这个问题?
# I tried this version:
markupsafe==2.1.1
# and then also this one:
markupsafe==2.0.1
Run Code Online (Sandbox Code Playgroud)
错误信息:
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.7/site-packages/markupsafe/__init__.py)
Run Code Online (Sandbox Code Playgroud)
我的docker-compose.yml:
version: '3'
services:
postgres:
image: postgres:11.2
environment:
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflow
- POSTGRES_DB=airflow
ports:
- "5432:5432"
webserver:
image: puckel/docker-airflow:1.10.4
build:
context: https://github.com/puckel/docker-airflow.git#1.10.4
dockerfile: Dockerfile
args:
AIRFLOW_DEPS: gcp_api,s3
restart: always
depends_on:
- postgres
environment:
- LOAD_EX=n
- EXECUTOR=Local
- FERNET_KEY=jsDPRErfv8Z_eVTnGfF8ywd19j4pyqE3NpdUBA_oRTo=
volumes:
- ./sparkify/dags:/usr/local/airflow/dags
# Uncomment …Run Code Online (Sandbox Code Playgroud) 我正在尝试让 Flask 和 Docker 应用程序正常工作,但是当我尝试docker-compose up在 Visual Studio 终端中使用命令运行它时,它给了我一个名为ImportError: cannot import name 'json' from itsdangerous. 我试图寻找解决这个问题的可能解决方案,但到目前为止,这里或其他地方的解决方案并不多。我能找到的唯一两个解决方案是将 MarkupSafe 及其危险的当前安装更改为更高版本:https://serverfault.com/questions/1094062/from-itsdangerous-import-json-as-json-importerror-cannot- import-name-json-fr和 GitHub 上的另一个告诉我从本质上再次更改 MarkUpSafe 及其危险的安装https://github.com/aws/aws-sam-cli/issues/3661,我也尝试过命名为安装软件包的虚拟环境veganetworkscriptenv,但也失败了。我目前使用 Flask 2.0.0 和 Docker 5.0.0,错误发生在 vegamain.py 的第八行。
这是我尝试运行该程序时收到的完整导入错误:
veganetworkscript-backend-1 | Traceback (most recent call last):
veganetworkscript-backend-1 | File "/app/vegamain.py", line 8, in <module>
veganetworkscript-backend-1 | from flask import Flask
veganetworkscript-backend-1 | File "/usr/local/lib/python3.9/site-packages/flask/__init__.py", line 19, in <module>
veganetworkscript-backend-1 | from . import json
veganetworkscript-backend-1 | File "/usr/local/lib/python3.9/site-packages/flask/json/__init__.py", …Run Code Online (Sandbox Code Playgroud) 我试图docker-compose通过环境变量传递我的 redis 密码,但它给了我错误。
这是我的 redis 镜像的一部分docker-compose.yml:
redis:
image: redis
container_name: redis
# command: redis-server --requirepass mypassword <--- this works as expected
# command: redis-server --requirepass ${REDIS_PASSWORD} <-- while this does not
command: redis-server --requirepass $${REDIS_PASSWORD} <-- and this does not work either
volumes:
- redis:/var/lib/redis/data
- ./redis.conf:/usr/local/etc/redis/redis.conf
ports:
- "6379"
env_file:
- .env.prod
Run Code Online (Sandbox Code Playgroud)
我的.env.prod:
REDIS_PASSWORD=mypassword
Run Code Online (Sandbox Code Playgroud)
它给了我一个错误:
consumer: Cannot connect to redis://:**@redis:6379/0: WRONGPASS invalid username-password pair or user is disabled..
Run Code Online (Sandbox Code Playgroud)
但是如果我直接在docker-compose.yml没有环境变量的情况下指定密码,那么它就可以工作。
这是我的第一篇文章,我是编码新手,所以如果您需要更多信息,请告诉我。我一直在运行一些人工智能来生成艺术品并且它一直在工作,但是当我重新加载它时,python 脚本将无法工作,并且现在显示“没有名为‘transformers’的模块”。谁能帮我吗?当我升级到 Google Colab Pro 时,我开始遇到问题,尽管我不确定为什么会产生影响。
ModuleNotFoundError
python artificial-intelligence importerror google-colaboratory huggingface-transformers
有没有办法在 VS Code 中安装扩展Dockerfile?
docker dockerfile visual-studio-code vscode-extensions vscode-remote
我的 Pod 声明了两个不同的卷。
我使用一些定义模板,并且根据某些情况的环境,我想对两个卷重复使用相同的声明。
这会导致错误:
Unable to mount volumes for pod "task-pv-pod_<...>": timeout expired waiting for volumes to attach/mount for pod "<...>"/"task-pv-pod". list of unattached/unmounted volumes=[task-pv-storage1]
Run Code Online (Sandbox Code Playgroud)
这是一个简化的 pod 定义:
kind: Pod
apiVersion: v1
metadata:
name: task-pv-pod
spec:
volumes:
- name: task-pv-storage1
persistentVolumeClaim:
claimName: task-pv-claim
- name: task-pv-storage2
persistentVolumeClaim:
claimName: task-pv-claim
containers:
- name: task-pv-container
image: nginx
ports:
- containerPort: 80
name: "http-server"
volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: task-pv-storage1
- mountPath: "/usr/share/nginx/something-else"
name: task-pv-storage2
Run Code Online (Sandbox Code Playgroud)
那么为什么它不起作用呢?
mount kubernetes mounted-volumes persistent-volumes persistent-volume-claims
这是一个已知的 Jenkins 问题,即管道重试操作在其内部超时时不会重试。
retry在超时发生后,肯定有一些解决方法可以强制(或替代)工作?
retry未触发的示例代码:
retry(3) {
timeout(time: 5, unit: 'MINUTES') {
// Something that can fail
}
}
Run Code Online (Sandbox Code Playgroud)
除非被捕获,否则超时错误 ( org.jenkinsci.plugins.workflow.steps.FlowInterruptedException) 会导致整个作业中止。
进入 docker 构建阶段时 Jenkins 作业失败:
docker build -t jumperiz/nodeapp .
Run Code Online (Sandbox Code Playgroud)
错误信息:
docker: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by docker)
docker: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by docker)
Run Code Online (Sandbox Code Playgroud)
附上我的构建图片。任何指导将不胜感激!
到目前为止,我们在 Jenkins 设置中使用的是带有用户名和密码凭据的 GitHub 插件。
但是,在 2021 年 8 月 13 日之后,此方法停止工作并引发此错误:
stderr: remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/了解更多信息。
根据如何在 Jenkins 中使用 Github 个人访问令牌中提供的答案
我将网址修改为:
https://<access token>@github.com/<userName>/<organization>/<repository>.git
但它不起作用。
我这里缺少任何步骤吗?
MLflow 运行完成后,外部脚本可以使用 pythonmlflow客户端和mlflow.get_run(run_id)方法访问其参数和指标,但Run返回的对象get_run似乎是只读的。
具体来说,.log_param .log_metric, 或.log_artifact不能用在 所返回的对象上get_run,从而引发如下错误:
AttributeError: 'Run' object has no attribute 'log_param'
Run Code Online (Sandbox Code Playgroud)
.log_*如果我们尝试在 上运行任何方法mlflow,它会将它们记录到实验中使用自动生成的运行 ID 的新运行中Default。
例子:
final_model_mlflow_run = mlflow.get_run(final_model_mlflow_run_id)
with mlflow.ActiveRun(run=final_model_mlflow_run) as myrun:
# this read operation uses correct run
run_id = myrun.info.run_id
print(run_id)
# this write operation writes to a new run
# (with auto-generated random run ID)
# in the "Default" experiment (with exp. ID of …Run Code Online (Sandbox Code Playgroud) docker ×5
python ×4
jenkins ×3
importerror ×2
databricks ×1
dependencies ×1
devops ×1
dockerfile ×1
flask ×1
git ×1
github ×1
kubernetes ×1
linux ×1
mlflow ×1
mount ×1
redis ×1
timeout ×1