Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,455,950
Community Members
 
Community Events
176
Community Groups

`serverless deploy` tries to execute `docker run` outside of $BITBUCKET_CLONE_DIR

Edited

I have a serverless python app that uses the plugin "serverless-python-requirements". In my bitbucket-pipelines.yml I have the following,

image: node:15.10.0-alpine

pipelines:
branches:
master:
- step:
name: 'Deployment to Staging'
deployment: staging
script:
- cd ./project_dir
- apk add python3
- npm install -g serverless
- npm install --save serverless-python-requirements
- serverless config credentials --provider aws --key $AWS_DEV_LAMBDA_KEY --secret $AWS_DEV_LAMBDA_SECRET
- serverless deploy --stage dev
services:
- docker

the last step progresses as follows,

+ serverless deploy --stage dev
Serverless: Generated requirements from /opt/atlassian/pipelines/agent/build/project_dir/requirements.txt in /opt/atlassian/pipelines/agent/build/project_dir/.serverless/requirements.txt...
Serverless: Installing requirements from /root/.cache/serverless-python-requirements/679f0c7a123e5d80212530da94d545f92ad890ecf43e8288e2b6bc243b4e138b_slspyc/requirements.txt ...
Serverless: Docker Image: lambci/lambda:build-python3.6
Serverless: Using download cache directory /root/.cache/serverless-python-requirements/downloadCacheslspycServerless: Running docker run --rm -v /root/.cache/serverless-python-requirements/679f0c7a123e5d80212530da94d545f92ad890ecf43e8288e2b6bc243b4e138b_slspyc\:/var/task\:z -v /root/.cache/serverless-python-requirements/downloadCacheslspyc\:/var/useDownloadCache\:z lambci/lambda\:build-python3.6 /bin/sh -c 'chown -R 0\\:0 /var/useDownloadCache && python3.6 -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'...

 until I get the following error:

Error --------------------------------------------------
Error: STDOUT:
STDERR: docker: Error response from daemon: authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectories.

I've tried using the serverless-deploy pipe option too but get the same error. 

- pipe: atlassian/serverless-deploy:0.2.2
variables:
AWS_ACCESS_KEY_ID: $AWS_DEV_LAMBDA_KEY
AWS_SECRET_ACCESS_KEY: $AWS_DEV_LAMBDA_SECRET
EXTRA_ARGS: '--stage dev'

I'm hoping this is an easy fix and I've done something silly!

**UPDATE**

I have it working by using the serverless.yml `non-linux` instead of `true` setting

custom:
pythonRequirements:
dockerizePip: non-linux

 and the bitbucket-pipelines.yml

image: node:15.10.0-alpine

pipelines:
branches:
master:
- step:
name: 'Deployment to Staging'
deployment: staging
script:
- cd ./project_dir
- apk add python3
- npm install
- npm install -g serverless
- serverless plugin install -n serverless-python-requirements
- serverless config credentials --overwrite --provider aws --key $AWS_DEV_LAMBDA_KEY --secret $AWS_DEV_LAMBDA_SECRET
- serverless deploy --stage dev

  however I still don't understand why the deployment using docker didn't work

2 answers

0 votes

Hi @Anthony Tsoi ,

We have added support for Python serverless-python-requirements.
A new version  of the serverless-deploy pipe released.

Also, updated NodeJS to 12 LTS version and the Serverless Framework to 2.* version.

script:
  - pipe: atlassian/serverless-deploy:1.0.0
    variables:
      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY

Tested it with the next dockerizePip parameters: true, false, non-linux.

 It would be nice if you provide us with your feedback about this update.

 

Cheers,
Oleksandr Kyrdan

Hi @Oleksandr Kyrdan 

I want to try out the serverless-deploy pipe, but is it possible to do that  with $AWS_SESSION_TOKEN ?, I have $AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY and $AWS_SESSION_TOKEN does the serverless pipe accept the $AWS_SESSION_TOKEN as variable.

 

Thanks

Rahul

0 votes

Hi @Anthony Tsoi ,

Thank you for your question!

We'll investigate this case and notify you.

 

Best regards,
Oleksandr Kyrdan

Thank you - any help would be appreciated!

@Oleksandr Kyrdan any luck with the above?

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events