Skip to content

examples deployment scripts refresh #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 25, 2020

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented Jun 19, 2020

motivation: make sure examples are up tp date

changes:

  • use swift:5.2 images instead of nighlies
  • compute dependencies to make zipfile as small as possible
  • make scripts more consistent

motivation: make sure examples are up tp date

changes:
* use swift:5.2 images instead of nighlies
* compute dependencies to make zipfile as small as possible
* make scripts more consistent
@tomerd tomerd changed the title examples refresh examples deployment scripts refresh Jun 19, 2020
cp -Pv /usr/lib/swift/linux/lib*so* "$target"
#cp -Pv /usr/lib/swift/linux/lib*so* "$target"
# add the target deps based on ldd
ldd ".build/release/$executable" | grep swift | awk '{print $3}' | xargs cp -Pv -t "$target"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 this is the most interesting part

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but could we copy the libicu libs directly (and not just the symlinks), if we specify xargs cp -Lv -t "$target"

From the man cp

      -L    If the -R option is specified, all symbolic links are followed.
      -P    If the -R option is specified, no symbolic links are followed.  This is the default.

cc @drexin

Copy link
Member

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, this looks much cleaner! Some questions inline...

echo "-------------------------------------------------------------------------"
echo "building \"$executable\" lambda"
echo "-------------------------------------------------------------------------"
docker run --rm -v "$workspace":/workspace -w /workspace/Examples/LambdaFunctions builder bash -cl "swift build --product $executable -c release -Xswiftc -g"
docker run --rm -v "$workspace":/workspace -w /workspace/Examples/LambdaFunctions builder \
bash -cl "swift build --product $executable -c release"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to fill a knowledge gap on my site: What's the benefit of using bash -cl "cmd" vs. just cmd

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -17,42 +17,25 @@ set -eu

# Lambda Function name (must exist in AWS Lambda)
lambda_name=SwiftSample

# S3 bucket name to upload zip file (must exist in AWS S3)
s3_bucket=swift-lambda-test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in some issue, we should make this bucket configurable since bucket names must be unique worldwide.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should prompt the user for the name of the bucket and lambda. is this what you are suggesting?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. maybe store it between runs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a prompt. wdyt?

cp -Pv /usr/lib/swift/linux/lib*so* "$target"
#cp -Pv /usr/lib/swift/linux/lib*so* "$target"
# add the target deps based on ldd
ldd ".build/release/$executable" | grep swift | awk '{print $3}' | xargs cp -Pv -t "$target"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but could we copy the libicu libs directly (and not just the symlinks), if we specify xargs cp -Lv -t "$target"

From the man cp

      -L    If the -R option is specified, all symbolic links are followed.
      -P    If the -R option is specified, no symbolic links are followed.  This is the default.

cc @drexin

@tomerd
Copy link
Contributor Author

tomerd commented Jun 24, 2020

@fabianfett updated

Copy link
Member

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tomerd tomerd merged commit b9224e2 into swift-server:master Jun 25, 2020
@tomerd tomerd deleted the examples-cleanup branch June 25, 2020 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants