Skip to content

Commit 6f14026

Browse files
authored
Merge branch 'awslabs:master' into master
2 parents 532e77c + 61ee326 commit 6f14026

File tree

5 files changed

+95
-38
lines changed

5 files changed

+95
-38
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Build Intensive
5+
on:
6+
push:
7+
branches: [ master ]
8+
pull_request_target:
9+
branches: [ master ]
10+
11+
permissions:
12+
id-token: write
13+
contents: read
14+
15+
jobs:
16+
build-intensive:
17+
timeout-minutes: 8
18+
runs-on: ${{ matrix.os }}
19+
defaults:
20+
run:
21+
shell: bash
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
27+
os: [ ubuntu-latest, macOS-latest, windows-latest ]
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Configure AWS Credentials
34+
uses: aws-actions/configure-aws-credentials@v4
35+
with:
36+
aws-region: us-east-1
37+
role-to-assume: arn:aws:iam::751999266872:role/GitHubWorkflows
38+
role-session-name: myGitHubActions
39+
40+
- name: Set up JDK 8
41+
uses: actions/setup-java@v4
42+
with:
43+
java-version: '8'
44+
distribution: 'corretto'
45+
46+
- name: Set up Python ${{ matrix.python-version }}
47+
uses: actions/setup-python@v2
48+
with:
49+
python-version: ${{ matrix.python-version }}
50+
51+
- name: Install Python and required pips
52+
run: |
53+
python -m pip install --upgrade pip
54+
pip install -r requirements.txt
55+
pip install -r test_requirements.txt
56+
pip install build
57+
58+
- name: Test with Pytest
59+
run: |
60+
python -m pytest
61+
62+
- name: Install .jar files
63+
run: |
64+
python -m build
65+
python setup.py download_jars
66+
python setup.py install
67+
68+
- name: Put words to sample stream
69+
run: |
70+
sample_kinesis_wordputter.py --stream kclpysample -w cat -w dog -w bird -w lobster -w octopus
71+
72+
- name: Start KCL application (windows or ubuntu)
73+
if: matrix.os != 'macOS-latest'
74+
run: |
75+
timeout 45 $(amazon_kclpy_helper.py --print_command --java $(which java) --properties samples/sample.properties) || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
76+
77+
- name: Start KCL application (macOS)
78+
if: matrix.os == 'macOS-latest'
79+
run: |
80+
brew install coreutils
81+
gtimeout 45 $(amazon_kclpy_helper.py --print_command --java $(which java) --properties samples/sample.properties) || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi

.github/workflows/run-unit-tests.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ From the root of this repo, run:
7070
python setup.py download_jars
7171
python setup.py install
7272

73+
If you'd like to override the default search location for the jars, you can set the `KCL_MVN_REPO_SEARCH_URL`
74+
environment variable to the location of the maven repository you'd like to use.
75+
76+
export KCL_MVN_REPO_SEARCH_URL=https://path/to/maven/repo
77+
7378
Now the `amazon_kclpy` and [boto][boto] (used by the sample putter script) and required
7479
jars should be installed in your environment. To start the sample putter, run:
7580

samples/amazon_kclpy_helper.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ def get_kcl_jar_path():
5454
:rtype: str
5555
:return: The absolute path of the KCL jar files needed to run the MultiLangDaemon.
5656
'''
57-
return ':'.join(glob(os.path.join(get_kcl_dir(), 'jars', '*jar')))
57+
if os.name == 'posix':
58+
return ':'.join(glob(os.path.join(get_kcl_dir(), 'jars', '*jar')))
59+
else:
60+
return ';'.join(glob(os.path.join(get_kcl_dir(), 'jars', '*jar')))
5861

5962
def get_kcl_classpath(properties=None, paths=[]):
6063
'''
@@ -81,7 +84,10 @@ def get_kcl_classpath(properties=None, paths=[]):
8184
# Add the dir that the props file is in
8285
dir_of_file = get_dir_of_file(properties)
8386
paths.append(dir_of_file)
84-
return ":".join([p for p in paths if p != ''])
87+
if os.name == 'posix':
88+
return ":".join([p for p in paths if p != ''])
89+
else:
90+
return ";".join([p for p in paths if p != ''])
8591

8692
def get_kcl_app_command(args, multi_lang_daemon_class, properties, log_configuration, paths=[]):
8793
'''

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def package_url(self, group_id, artifact_id, version):
115115
# Sample url:
116116
# https://search.maven.org/remotecontent?filepath=org/apache/httpcomponents/httpclient/4.2/httpclient-4.2.jar
117117
#
118-
prefix = 'https://search.maven.org/remotecontent?filepath='
118+
prefix = os.getenv("KCL_MVN_REPO_SEARCH_URL", 'https://search.maven.org/remotecontent?filepath=')
119119
return '{prefix}{path}/{artifact_id}/{version}/{dest}'.format(
120120
prefix=prefix,
121121
path='/'.join(group_id.split('.')),

0 commit comments

Comments
 (0)