Skip to content

Commit 5ecdad7

Browse files
committed
Windows: Updated manual_build.py with a link to GH releases
1 parent 9068a62 commit 5ecdad7

File tree

3 files changed

+14
-26
lines changed

3 files changed

+14
-26
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
- Use new gp3 volumes instead of gp2 since they're more cost effective and provide 3000 IOPS baseline
1919
- Removed SchedulerPublicIPAllocation from Scheduler.template as it's no longer used
2020
- Updated CentOS, ALI2 and RHEL76 AMIs
21-
- Fixed manual builds on Windows+Cygwin environments
2221

2322
## [2.6.0] - 2020-10-29
2423
### Added

source/manual_build.py

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@ def get_input(prompt):
3535
import boto3
3636
from requests import get
3737
import requests.exceptions
38-
import massedit
3938
from botocore.client import ClientError
4039
from botocore.exceptions import ProfileNotFound
4140
except ImportError:
42-
print(" > You must have 'massedit, 'colored', 'boto3' and 'requests' installed. Run 'pip install boto3 colored requests massedit' or 'pip install -r requirements.txt' first")
41+
print(" > You must have , 'colored', 'boto3' and 'requests' installed. Run 'pip install boto3 colored requests massedit' or 'pip install -r requirements.txt' first")
42+
exit(1)
43+
44+
if os.name == "nt":
45+
print("%sSorry, Windows builds are currently not supported. Please use a UNIX system if you want to do a custom build\n%s" % (fg('yellow'), attr('reset')))
46+
print("%s=== How to install SOCA on Window s===%s" % (fg('yellow'), attr('reset')))
47+
print("%s1 - Download the latest release (RELEASE-<version>.tar.gz) from https://github.com/awslabs/scale-out-computing-on-aws/releases%s" % (fg('yellow'), attr('reset')))
48+
print("%s2 - Install SOCA via https://awslabs.github.io/scale-out-computing-on-aws/install-soca-cluster/#option-2-download-the-latest-release-targz%s" % (fg('yellow'), attr('reset')))
4349
exit(1)
4450

4551
parser = argparse.ArgumentParser(description='Build & Upload SOCA CloudFormation resources.')
@@ -66,16 +72,17 @@ def get_input(prompt):
6672
session = boto3.session.Session(profile_name=args.profile)
6773
s3 = session.resource('s3', region_name=region)
6874
except ProfileNotFound:
69-
print(" > Profile %s not found. Check ~/.aws/credentials file." % args.profile)
75+
print("%s> Profile %s not found. Check ~/.aws/credentials file.%s" % (fg('red'), args.profile, attr('reset')))
7076
exit(1)
77+
7178
else:
7279
s3 = boto3.resource('s3', region_name=region)
7380
s3.meta.client.head_bucket(Bucket=bucket)
7481
s3_bucket_exists = True
7582
except ClientError as e:
76-
print(" > The bucket " + bucket + " does not exist or you have no access.")
77-
print(e)
78-
print(" > Building locally but not uploading to S3")
83+
print("%s > The bucket %s does not exist or you have no access.%s" % (fg('red'), bucket, attr('reset')))
84+
print("%s %s %s" % (fg('red'), e, attr('reset')))
85+
print("%s> Building locally but not uploading to S3%s" % (fg('yellow'), attr('reset')))
7986

8087
# Detect Client IP
8188
try:
@@ -111,25 +118,8 @@ def get_input(prompt):
111118
print(line.replace('%%BUCKET_NAME%%', 'your-s3-bucket-name-here').replace('%%SOLUTION_NAME%%/%%VERSION%%', 'your-s3-folder-name-here').replace('\n', ''))
112119

113120
print(" > Creating archive for build id: " + unique_id)
114-
115-
# Sanitize build (remove unwanted characters, esp when you build with Cygwin)
116-
wrong_chars = ["\\r", "\\^M"]
117-
for path, subdirs, files in os.walk(build_folder + '/'):
118-
for file in files:
119-
file = build_path + "/" + build_folder + '/' + file
120-
if file.endswith(".template") \
121-
or file.endswith(".sh") \
122-
or file.endswith(".cfg") \
123-
or file.endswith(".txt"):
124-
for char in wrong_chars:
125-
massedit.edit_files([file],
126-
["re.sub(r'" + char + "', '', line)"],
127-
dry_run=False)
128-
129121
make_archive('dist/' + output_prefix, 'gztar', build_folder)
130122

131-
132-
133123
if s3_bucket_exists:
134124
print("====== Upload to S3 ======\n")
135125
print(" > Uploading required files ... ")

source/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
boto3
22
colored
3-
requests
4-
massedit
3+
requests

0 commit comments

Comments
 (0)