Google cloud build permission error while deploying rasa to App engine

五迷三道 提交于 2021-02-11 14:55:12

问题


I am trying to deploy a rasa project described like here to google app engine, But the build failed due to some permission issues

The scripts try to create a folder inside container,

FROM rasa/rasa
ENV BOT_ENV=production

COPY . /var/www
WORKDIR /var/www

RUN rasa train

ENTRYPOINT [ "rasa", "run", "-p", "8080"]

I have added following permissions to google cloud build.

Error log frome cloud build.

Epochs: 100%|██████████| 100/100 [00:16<00:00,  6.04it/s, t_loss=1.485, i_loss=0.104, i_acc=1.000]
2020-05-31 18:05:25 INFO     rasa.utils.tensorflow.models  - Finished training.
2020-05-31 18:05:25 INFO     rasa.nlu.model  - Finished training component.
2020-05-31 18:05:25 INFO     rasa.nlu.model  - Starting to train component EntitySynonymMapper
2020-05-31 18:05:25 INFO     rasa.nlu.model  - Finished training component.
2020-05-31 18:05:25 INFO     rasa.nlu.model  - Starting to train component ResponseSelector
2020-05-31 18:05:25 INFO     rasa.nlu.selectors.response_selector  - Retrieval intent parameter was left to its default value. This response selector will be trained on training examples combining all retrieval intents.
2020-05-31 18:05:25 INFO     rasa.nlu.model  - Finished training component.
2020-05-31 18:05:25 INFO     rasa.nlu.model  - Successfully saved model into '/tmp/tmpha6sd3hw/nlu'
Training Core model...
Core model training completed.
Training NLU model...
NLU model training completed.
Traceback (most recent call last):
  File "/opt/venv/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/opt/venv/lib/python3.7/site-packages/rasa/__main__.py", line 108, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/opt/venv/lib/python3.7/site-packages/rasa/cli/train.py", line 77, in train
    nlu_additional_arguments=extract_nlu_additional_arguments(args),
  File "/opt/venv/lib/python3.7/site-packages/rasa/train.py", line 52, in train
    nlu_additional_arguments=nlu_additional_arguments,
  File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
  File "/opt/venv/lib/python3.7/site-packages/rasa/train.py", line 107, in train_async
    nlu_additional_arguments=nlu_additional_arguments,
  File "/opt/venv/lib/python3.7/site-packages/rasa/train.py", line 206, in _train_async_internal
    fixed_model_name=fixed_model_name,
  File "/opt/venv/lib/python3.7/site-packages/rasa/model.py", line 464, in package_model
    create_package_rasa(train_path, output_directory, fingerprint)
  File "/opt/venv/lib/python3.7/site-packages/rasa/model.py", line 258, in create_package_rasa
    os.makedirs(output_directory)
  File "/usr/local/lib/python3.7/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: 'models'
The command '/bin/bash -o pipefail -c rasa train' returned a non-zero code: 1
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1

also facing the same issue when doing gcloud app deploy from cloud shell

my repo of the source code, need to remove cloudbuild.yaml before running gcloud app deploy


回答1:


It was due to permission issue of the docker, fixed by adding the USER root

FROM rasa/rasa
USER root
ENV BOT_ENV=production

COPY . /var/www
WORKDIR /var/www

RUN rasa train

ENTRYPOINT [ "rasa", "run", "-p", "8080"]


来源:https://stackoverflow.com/questions/62120734/google-cloud-build-permission-error-while-deploying-rasa-to-app-engine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!