Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
- NEW: Add support of the asynchronous metering mechanism
Browse files Browse the repository at this point in the history
- NEW: Include DRM Library settings in requests
- NEW: Support the new data format in the ROM of the DRM Controller
- NEW: Show host and card information when XRT utilities are installed
- NEW: Show CSP information when available
- NEW: Add Ubuntu to the regression suite
- NEW: Support environment variables: ONEPORTAL_URL, ONEPORTAL_CLIENT_ID, ONEPORTAL_CLIENT_SECRET
- NEW: Log file support "append" mode
- NEW: Validate the support of xclRegRead and xclRegWrite for CPP, OpenCL and Py APIs
- FIX: Refactor retry mechanism from API functions
- DOC: Update documentation: thanks to customers for their feedback
- DOC: Add migration page
  • Loading branch information
xlz-jbleclere committed Sep 15, 2020
1 parent 994e71f commit 48c5034
Show file tree
Hide file tree
Showing 145 changed files with 17,371 additions and 3,636 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
* Wed Sep 9 2020 Accelize v2.5.0
- NEW: Add support of the asynchronous metering mechanism
- NEW: Include DRM Library settings in requests
- NEW: Support the new data format in the ROM of the DRM Controller
- NEW: Show host and card information when XRT utilities are installed
- NEW: Show CSP information when available
- NEW: Add Ubuntu to the regression suite
- NEW: Support environment variables: ONEPORTAL_URL, ONEPORTAL_CLIENT_ID, ONEPORTAL_CLIENT_SECRET
- NEW: Log file support "append" mode
- NEW: Validate the support of xclRegRead and xclRegWrite for CPP, OpenCL and Py APIs
- FIX: Refactor retry mechanism from API functions
- DOC: Update documentation: thanks to customers for their feedback
- DOC: Add migration page

* Thu Apr 30 2020 Accelize v2.4.1
- FIX: Correct BIST to allow HDK v3.x

Expand Down
21 changes: 19 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cmake_minimum_required(VERSION 3.12)
# - Alpha : 1.0.0-alpha.1
# - Beta : 1.0.0-beta.1
# - Release candidate : 1.0.0-rc.1
set(ACCELIZEDRM_VERSION 2.4.1)
set(ACCELIZEDRM_VERSION 2.5.0-rc.2)

## Define package release number (Number of time this version was packaged)
if (NOT CPACK_PACKAGE_RELEASE)
Expand Down Expand Up @@ -95,13 +95,16 @@ set(CMAKE_CXX_STANDARD 11)
add_compile_options(-fvisibility=hidden)
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
# Enable warnings
add_compile_options(-O0 -Wall -Wextra -Wnon-virtual-dtor -Wpedantic -Werror=format-security)
add_compile_options(-Wall -Wextra -Wnon-virtual-dtor -Wpedantic -Werror=format-security)

# Optimize for Debugging
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
add_compile_options(-fdebug-prefix-map=${CMAKE_SOURCE_DIR}=.)
endif()

# ABI check
add_compile_options(-g -Og)

# Code coverage
option(COVERAGE "Activate code coverage" OFF)
if(COVERAGE)
Expand Down Expand Up @@ -150,6 +153,8 @@ set(DRM_CONTROLLER_SDK_SOURCES
drm_controller_sdk/source/HAL/DrmControllerRegistersStrategy_v4_0_0.cpp
drm_controller_sdk/source/HAL/DrmControllerRegistersStrategy_v4_0_1.cpp
drm_controller_sdk/source/HAL/DrmControllerRegistersStrategy_v4_1_0.cpp
drm_controller_sdk/source/HAL/DrmControllerRegistersStrategy_v4_2_0.cpp
drm_controller_sdk/source/HAL/DrmControllerRegistersStrategy_v4_2_1.cpp
)
include_directories(drm_controller_sdk/include)
set_source_files_properties(${DRM_CONTROLLER_SDK_SOURCES} PROPERTIES COMPILE_FLAGS "-Wno-unused-parameter")
Expand Down Expand Up @@ -198,6 +203,7 @@ set(TARGET_SOURCES
spdlog/src/color_sinks.cpp
spdlog/src/file_sinks.cpp
source/ws_client.cpp
source/csp.cpp
source/drm_manager.cpp
source/utils.cpp
source/error.cpp
Expand Down Expand Up @@ -567,3 +573,14 @@ if(TESTS)
endif()
endif()
endif()

# uninstall target
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)

add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

[![Build Status](https://dev.azure.com/Accelize/DRM/_apis/build/status/DRM%20Library?branchName=master)](https://dev.azure.com/Accelize/DRM/_build/latest?definitionId=2&branchName=master)[![codecov](https://codecov.io/gh/Accelize/drmlib/branch/master/graph/badge.svg)](https://codecov.io/gh/Accelize/drmlib)

# :closed_lock_with_key: Accelize DRM library : AccelDRM

The Accelize DRM solution protects FPGA applications.

The Accelize DRM library operates the DRM from the software side of the
application.

This library is responsible for activating the DRM, communicating with the
Accelize web service and managing metering sessions.

This library provides **API** for :
* C
* C++
* Python

Interested in Accelize DRM ? Checkout our [Documentation](https://tech.accelize.com/documentation/stable)!

# :key: Accelize licensing solution

The Accelize licensing technology is offered in two distinct modes:
Expand Down Expand Up @@ -36,10 +53,15 @@ More information in our [documentation](https://tech.accelize.com/documentation/

For a quick tour about the Accelize platform integration steps, please watch [this video](https://youtu.be/7cb_ksLTcRk)

# :registered: License
## :heavy_exclamation_mark: Prerequisites

To access the Accelize Web Service you need an Internet connection which allows
outbound HTTPS connection to Accelize [server](https://master.metering.accelize.com)

## :registered: License

Please consult the Accelize DRM library [license](LICENSE)
Please consult [license](LICENSE)

# :floppy_disk: Changelog
## :floppy_disk: Changelog

Please consult [CHANGELOG](CHANGELOG)
21 changes: 21 additions & 0 deletions cmake_uninstall.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
endif()

file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif()
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif()
endforeach()
3 changes: 3 additions & 0 deletions deployment/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ python3 -m pip install -U{% if osName in ("centos", "rhel") and osVersion == "7"
flake8 \
pytest \
requests \
flask \
python-dateutil \
pytest-flask \
tox \
wheel

Expand Down
13 changes: 11 additions & 2 deletions deployment/acid_drm.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_next_package_release(versions_json):
return next_release


def publish_packages(pkg_source, versions_json, deb_repo, rpm_repo,
def publish_packages(pkg_source, versions_json, deb_repo, rpm_repo, deb_s3,
gpg_private_key, gpg_key_id):
"""
Publish Accelize DRM library packages.
Expand All @@ -64,6 +64,7 @@ def publish_packages(pkg_source, versions_json, deb_repo, rpm_repo,
number for all versions.
deb_repo (str): Path to local DEB repository.
rpm_repo (str): Path to local RPM repository.
deb_s3 (str): S3 DEB repository.
gpg_private_key (str): Path to GPG key to use to sign packages.
gpg_key_id (str): ID of the GPG key to use to sign packages.
"""
Expand All @@ -82,12 +83,20 @@ def publish_packages(pkg_source, versions_json, deb_repo, rpm_repo,
component = 'prerelease' if prerelease else 'stable'
repo_base_url = "https://tech.accelize.com"

branch = run(("git", "branch", "--show-current"), capture_output=True, check=True)
if prerelease:
assert branch != "master"
assert deb_s3.endswith("deb_prerelease/")
else:
assert branch == "master"
assert deb_s3.endswith("deb/")

deb_conf = {
'Origin': 'Accelize',
'Label': 'Accelize',
'Codename': None,
'Architectures': 'amd64',
'Components': 'stable prerelease',
'Components': component,
'Description': 'Accelize DEB repository',
'SignWith': gpg_key_id
}
Expand Down
95 changes: 17 additions & 78 deletions deployment/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,87 +69,22 @@ stages:
meteringServer: prod
${{ if ne(variables['Build.SourceBranch'], 'refs/heads/master') }}:
meteringServer: dev
${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags') }}:
tox_minimum: '-m minimum'
${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/tags')) }}:
tox_minimum: ''

jobs:

# Start agents
- template: agents/start.yml@acid
- template: runTestOnEc2.yml
parameters:
jobName: startAgent_AwsF1
agentDescription: AWS F1
provider: awsEc2
instanceType: f1.4xlarge
acidDir: $(Build.SourcesDirectory)/deployment/acid
ansiblePlaybook: $(Build.SourcesDirectory)/deployment/playbook.yml

# Run tests on agents
- job: runTests_AwsF1
displayName: Run tests on AWS F1
dependsOn: startAgent_AwsF1
pool:
name: Default
demands: # Use previously instantiated agent
- agent.Name -equals $(Build.BuildId) $(Build.DefinitionName) AWS F1

steps:

- script: |
cat << EOF > $(Build.SourcesDirectory)/cred.json
{
"client_id": "$(clientIdAccelizeAcceleratorTest2)",
"client_secret": "$(clientSecretAccelizeAcceleratorTest2)",
"name__admin__":"Admin_JBL_Regression",
"client_id__admin__":"$(clientIdAdmin)",
"client_secret__admin__":"$(clientSecretAdmin)",
"client_id__accelize_accelerator_test_01__":
"$(clientIdAccelizeAcceleratorTest1)",
"client_secret__accelize_accelerator_test_01__":
"$(clientSecretAccelizeAcceleratorTest1)",
"email__accelize_accelerator_test_01__":
"$(mailAccelizeAcceleratorTest1)",
"client_id__accelize_accelerator_test_02__":
"$(clientIdAccelizeAcceleratorTest2)",
"client_secret__accelize_accelerator_test_02__":
"$(clientSecretAccelizeAcceleratorTest2)",
"email__accelize_accelerator_test_02__":
"$(mailAccelizeAcceleratorTest2)",
"client_id__accelize_accelerator_test_03__":
"$(clientIdAccelizeAcceleratorTest3)",
"client_secret__accelize_accelerator_test_03__":
"$(clientSecretAccelizeAcceleratorTest3)",
"email__accelize_accelerator_test_03__":
"$(mailAccelizeAcceleratorTest3)",
"client_id__accelize_accelerator_test_04__":
"$(clientIdAccelizeAcceleratorTest4)",
"client_secret__accelize_accelerator_test_04__":
"$(clientSecretAccelizeAcceleratorTest4)",
"email__accelize_accelerator_test_04__":
"$(mailAccelizeAcceleratorTest4)"
}
EOF
displayName: Create Accelize credentials file
- script: sudo -E tox -p all -e
aws-build-debug,cpp-debug,c-debug,integration-debug,coverage-debug
-- --cred=$(Build.SourcesDirectory)/cred.json --server=$(meteringServer)
displayName: Run tests with Tox
env:
CODECOV_TOKEN: $(codecovToken)
TOX_PARALLEL_NO_SPINNER: 1
SDK_DIR: /opt/aws_fpga/sdk

# Stop agents
- template: agents/stop.yml@acid
parameters:
provider: awsEc2
agentDescription: AWS F1
acidDir: $(Build.SourcesDirectory)/deployment/acid
dependsOn: runTests_AwsF1
instance_type: 'f1.4xlarge'
config_list:
- os_distrib: 'centos_7'
tox_extra_option: '-k "not test_abi_compliance" $(tox_minimum)'
- os_distrib: 'ubuntu_18_04'
tox_extra_option: '-k "not test_abi_compliance" $(tox_minimum)'
dependsOn: 'centos_7'

- stage: release
displayName: Release
Expand Down Expand Up @@ -341,7 +276,10 @@ stages:
variables:
# DEB and RPM repositories paths
debRepo: /tmp/deb_repo
debS3: s3://accelize/deb/
${{ if not(contains(variables['Build.SourceBranch'], '-')) }}:
debS3: s3://accelize/deb/
${{ if contains(variables['Build.SourceBranch'], '-') }}:
debS3: s3://accelize/deb_prerelease/
rpmRepo: /tmp/rpm_repo
rpmS3: s3://accelize/rpm/

Expand Down Expand Up @@ -410,6 +348,7 @@ stages:
pkg_source='$(Pipeline.Workspace)',
versions_json='$(versionsJson)',
deb_repo='$(debRepo)', rpm_repo='$(rpmRepo)',
deb_s3='$(debS3)',
gpg_private_key='$(gpgPrivateKey.secureFilePath)',
gpg_key_id='$(gpgKeyId)')
Expand Down
Loading

0 comments on commit 48c5034

Please sign in to comment.