Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/privileged-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Build Intensive
on:
push:
branches: [ master ]
pull_request_target:
branches: [ master ]

permissions:
id-token: write
contents: read

jobs:
build-intensive:
timeout-minutes: 8
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash

strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
os: [ ubuntu-latest, macOS-latest, windows-latest ]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::751999266872:role/GitHubWorkflows
role-session-name: myGitHubActions

- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'corretto'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Python and required pips
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r test_requirements.txt
pip install build

- name: Test with Pytest
run: |
python -m pytest

- name: Install .jar files
run: |
python -m build
python setup.py download_jars
python setup.py install

- name: Put words to sample stream
run: |
sample_kinesis_wordputter.py --stream kclpysample -w cat -w dog -w bird -w lobster -w octopus

- name: Start KCL application (windows or ubuntu)
if: matrix.os != 'macOS-latest'
run: |
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

- name: Start KCL application (macOS)
if: matrix.os == 'macOS-latest'
run: |
brew install coreutils
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
35 changes: 0 additions & 35 deletions .github/workflows/run-unit-tests.yml

This file was deleted.

10 changes: 8 additions & 2 deletions samples/amazon_kclpy_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ def get_kcl_jar_path():
:rtype: str
:return: The absolute path of the KCL jar files needed to run the MultiLangDaemon.
'''
return ':'.join(glob(os.path.join(get_kcl_dir(), 'jars', '*jar')))
if os.name == 'posix':
return ':'.join(glob(os.path.join(get_kcl_dir(), 'jars', '*jar')))
else:
return ';'.join(glob(os.path.join(get_kcl_dir(), 'jars', '*jar')))

def get_kcl_classpath(properties=None, paths=[]):
'''
Expand All @@ -81,7 +84,10 @@ def get_kcl_classpath(properties=None, paths=[]):
# Add the dir that the props file is in
dir_of_file = get_dir_of_file(properties)
paths.append(dir_of_file)
return ":".join([p for p in paths if p != ''])
if os.name == 'posix':
return ":".join([p for p in paths if p != ''])
else:
return ";".join([p for p in paths if p != ''])

def get_kcl_app_command(args, multi_lang_daemon_class, properties, log_configuration, paths=[]):
'''
Expand Down