Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,105
Community Members
 
Community Events
168
Community Groups

Serverless deploy with plugins and dockerpip

Edited

I am unable to figure out why the serverless deploy is not going through.

 

This is the bibucket-pipeline.yml


options
:
docker: true

definitions:
services:
docker:
memory: 3072
pipelines:
branches:

dev:
- step:
services:
- docker
script:
- cp config.dev.ini config.ini
- pipe: atlassian/serverless-deploy:1.2.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID_DEV
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY_DEV
PRE_EXECUTION_SCRIPT: "my-script.sh"
 EXTRA_ARGS: "--verbose"
Error during serverless deploy
Installing requirements from "/root/.cache/serverless-python-requirements/1f8875b144ca0ef6448bc54adcda2143dac724167f52c31feeb3279ccc4a6bc1_x86_64_slspyc/requirements.txt"
Docker Image: lambci/lambda:build-python3.8
Using download cache directory /root/.cache/serverless-python-requirements/downloadCacheslspyc
Running docker run --rm -v /root/.cache/serverless-python-requirements/1f8875b144ca0ef6448bc54adcda2143dac724167f52c31feeb3279ccc4a6bc1_x86_64_slspyc\:/var/task\:z -v /root/.cache/serverless-python-requirements/downloadCacheslspyc\:/var/useDownloadCache\:z lambci/lambda\:build-python3.8 /bin/sh -c 'chown -R 0\\:0 /var/useDownloadCache && python3 -m pip install -t /var/task/ -r /var/task/requirements.txt --cache-dir /var/useDownloadCache && chown -R 0\\:0 /var/task && chown -R 0\\:0 /var/useDownloadCache && find /var/task -name \\*.so -exec strip \\{\\} \\;'...
Stdout:
Stderr: docker: Error response from daemon: authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectories.
See 'docker run --help'.
Environment: linux, node 16.17.0, framework 3.22.0 (local) 3.22.0v (global), plugin 6.2.2, SDK 4.3.2


Credentials: Local, environment variables

Docs: docs.serverless.com

Support: forum.serverless.com

Bugs: github.com/serverless/serverless/issues


Error:

Error: `docker run --rm -v /root/.cache/serverless-python-requirements/1f8875b144ca0ef6448bc54adcda2143dac724167f52c31feeb3279ccc4a6bc1_x86_64_slspyc:/var/task:z -v /root/.cache/serverless-python-requirements/downloadCacheslspyc:/var/useDownloadCache:z lambci/lambda:build-python3.8 /bin/sh -c chown -R 0\:0 /var/useDownloadCache && python3 -m pip install -t /var/task/ -r /var/task/requirements.txt --cache-dir /var/useDownloadCache && chown -R 0\:0 /var/task && chown -R 0\:0 /var/useDownloadCache && find /var/task -name \*.so -exec strip \{\} \;` Exited with code 125

at ChildProcess.<anonymous> (/opt/atlassian/pipelines/agent/build/node_modules/child-process-ext/spawn.js:38:8)

at ChildProcess.emit (node:events:513:28)

at ChildProcess.emit (node:domain:489:12)

at maybeClose (node:internal/child_process:1093:16)

at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)

serverless.yml

custom:

pythonRequirements:

pythonBin: python3

dockerizePip: true

slim: true

useDownloadCache: true

useStaticCache: true

Any help would be very much appreciated. It loks like its because of useDownloadCache or this could be it - $BITBUCKET_CLONE_DIR and its subdirectories.

 

 

2 answers

0 votes

@Aakash Shah hi. Could your share also your pre-execution script?

 

Regards, Igor

0 votes
Syahrul Atlassian Team Sep 11, 2022

Hey @Aakash Shah 

Welcome to the community.

I believe the error is related to the execution permission of the script. As mentioned in the documentation here if you pass a hook script, the script should have at least read and execution permission. 

I would suggest changing the script permission with the following step:

  - chmod 005 my-script.sh
  - pipe: atlassian/serverless-deploy:1.2.0
    variables:
      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
      PRE_EXECUTION_SCRIPT: '.my-script.sh'

Cheers,
Syahrul

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

3,462 views 3 10
Read article

Atlassian Community Events