Skip to content
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

Github actions cutover and linting #112

Merged
merged 28 commits into from May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
129 changes: 0 additions & 129 deletions .circleci/config.yml

This file was deleted.

File renamed without changes.
5 changes: 4 additions & 1 deletion .github/workflows/check-pypi.yml
@@ -1,6 +1,9 @@
name: Check if required secrets are set to publish to Pypi

on: push
on:
push:
branches:
- master

jobs:
checksecret:
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/platform_builds.yml
@@ -0,0 +1,65 @@
name: Reqpack builds
on:
push:
branches:
- master
- '[0-9].[0-9]'

jobs:

platform-build:
runs-on: ubuntu-latest
strategy:
max-parallel: 10
matrix:
osnick: [bionic, xenial, centos7, rocky8]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
repository: redislabsmodules/readies
path: deps/readies
- name: dependencies
run: |
./deps/readies/bin/getpy2
./sbin/system-setup.py
- name: Platform build ${{matrix.osnick}}
run: |
OSNICK=${{matrix.osnick}} ./build/reqpacks/build
- name: persist
uses: actions/upload-artifact@v3
with:
name: rgsync-${{matrix.osnick}}.zip
path: |
bin/artifacts/*.zip

deploy-artifacts:
needs: ['platform-build']
runs-on: ubuntu-latest
steps:
- name: set up s3cmd
uses: s3-actions/s3cmd@v1.2.0
with:
provider: aws
region: us-east-1
access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: fetch dependencies
uses: actions/download-artifact@v3
with:
path: artifacts
- name: display downloaded file structure
run: ls -R
working-directory: artifacts

- name: deploy artifacts to s3 snapshots
working-directory: artifacts
run: |
s3cmd put */*.zip --acl-public s3://redismodules/rgsync/snapshots/
if: startsWith(github.ref, 'refs/tags/') != true

- name: deploy artifacts to s3 snapshots
working-directory: artifacts
run: |
s3cmd put */*.zip --acl-public s3://redismodules/rgsync/snapshots/
if: startsWith(github.ref, 'refs/tags/')
24 changes: 22 additions & 2 deletions .github/workflows/tox-tests.yml
Expand Up @@ -2,8 +2,27 @@ name: WriteBehind Tests
on: push

jobs:

lint:
name: lint
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python-version}}

- name: Install Dependencies
run: |
pip install --user -r .github/requirements.txt

- name: Run the linter
run: tox -e linters

run_tests:
name: Run tests
runs-on: ubuntu-latest
strategy:
max-parallel: 15
Expand Down Expand Up @@ -44,8 +63,9 @@ jobs:
- name: Install Dependencies
run: |
poetry install
pip install --user -r .circleci/circle_requirements.txt
pip install --user -r .github/requirements.txt

- name: run ${{ matrix.toxenv }} tests
run: |
tox -e ${{ matrix.toxenv }}

1 change: 0 additions & 1 deletion README.md
@@ -1,5 +1,4 @@
[![license](https://img.shields.io/github/license/RedisGears/rgsync.svg)](https://github.com/RedisGears/rgsync)
[![CircleCI](https://circleci.com/gh/RedisGears/rgsync/tree/master.svg?style=svg)](https://circleci.com/gh/RedisGears/rgsync/tree/master)
![GitHub Actions](https://github.com/redisgears/rgsync/actions/workflows/tox-tests.yml/badge.svg)
[![PyPI version](https://badge.fury.io/py/rgsync.svg)](https://badge.fury.io/py/rgsync)
[![Known Vulnerabilities](https://snyk.io/test/github/RedisGears/rgsync/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/RedisGears/rgsync?targetFile=requirements.txt)
Expand Down
20 changes: 20 additions & 0 deletions build/reqpacks/dockerfile.tmpl
@@ -0,0 +1,20 @@

ARG GEARS_VERSION=master

# OSNICK=bionic|stretch|buster
ARG OSNICK=buster

# ARCH=x64|arm64v8|arm32v7
ARG ARCH=x64

#----------------------------------------------------------------------------------------------
FROM redisfab/redisgears:${GEARS_VERSION}-${ARCH}-${OSNICK}

WORKDIR /rgsync

ADD . /rgsync

RUN ./deps/readies/bin/getpy3
RUN ./build/reqpacks/system-setup.py

CMD ["--loadmodule", "/var/opt/redislabs/lib/modules/redisgears.so", "Plugin", "/var/opt/redislabs/modules/rg/plugin/gears_python.so"]
8 changes: 4 additions & 4 deletions build/reqpacks/system-setup.py
Expand Up @@ -22,15 +22,15 @@ def common_first(self):
self.pip_install("setuptools --upgrade")

self.install("git zip unzip libxml2")
self.run("%s/bin/enable-utf8" % READIES)
self.run(f"{READIES}/bin/enable-utf8")

def debian_compat(self):
self.run("%s/bin/getgcc" % READIES)
self.run(f"{READIES}/bin/getgcc")
self.install("libsqlite3-dev")
self.install("unixodbc-dev")

def redhat_compat(self):
self.run("%s/bin/getgcc" % READIES)
self.run(f"{READIES}/bin/getgcc")
self.install("redhat-lsb-core")
if self.os_version[0] >= 8 and self.dist in ['centos', 'ol']:
self.install("sqlite-devel")
Expand All @@ -39,7 +39,7 @@ def redhat_compat(self):
self.install("unixODBC-devel")

def fedora(self):
self.run("%s/bin/getgcc" % READIES)
self.run(f"{READIES}/bin/getgcc")

def macos(self):
self.install_gnu_utils()
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Expand Up @@ -26,6 +26,7 @@ python = "^3.6.2"
redis = "^4.2.0"
SQLAlchemy = "1.4.35"
pymongo = "4.1.1" # located here, because it achieves the same goal as sqlalchemy
flynt = "^0.76"

[tool.poetry.dev-dependencies]
flake8 = "^3.9.2"
Expand All @@ -44,6 +45,7 @@ cryptography = "^3.4.7"
psycopg2-binary = "^2.9.3"
ibm-db = "^3.1.1"
ibm-db-sa = "^0.3.7"
isort = "^5.10.1"

[tool.pytest.ini_options]
markers = [
Expand All @@ -54,6 +56,9 @@ markers = [
"db2: db2 backend tests",
]

[tool.isort]
profile = "black"

[build-system]
requires = ["poetry-core>=1.0.6"]
build-backend = "poetry.core.masonry.api"