Changelog
v1.19.2
fix: Fix for slow cache responses.
v1.19.1 (unreleased)
fix: Updated cache prefix deletion in PlatformCacheRepository to use correct method (
flush_by_pattern) instead ofdelete_by_prefix
v1.19.0
feat: Added Cache Decorators module to Peak SDK providing API level caching with intelligent invalidation patterns.
@cache_resultdecorator for caching expensive function results with configurable TTL and smart key generation@invalidate_cachedecorator for pattern-based cache invalidation with targeted and broad strategiesEntity-aware cache key generation with deployment isolation for multi-tenant support
Fallback strategy with automatic fallback from platform cache to in-memory cache
Support for both synchronous and asynchronous functions in FastAPI applications
HTTP Cache-Control integration for respecting web standard caching directives
v1.18.3
fix: Pin the version of rich to 14.0.0
v1.18.2
fix: Added more test in cache module to increase coverage to 100 percent
fix: Add Fallback to flush methods in case of CROSSLOT error
v1.18.1
fix: Typer & click version conflicts with Orion.
v1.18.0
feat: Added Cache module to Peak SDK providing caching functionality using Valkey (Redis-compatible).
The cache module offers tenant isolation with auto key prefixing to ensure data separation between tenants.
Auto JSON serialization and deserialization for complex data types.
Comprehensive connection management with automatic credential retrieval and connection pooling.
Full suite of cache operations:
set,get,delete,exists,expire,ttl,mget,mset,flush_tenant,ping, andclose.Optimized for high-throughput operations with SSL/TLS support and configurable timeouts.
Support for flushing keys by pattern matching and tenant-specific cache clearing.
Support for additional prefix configuration for advanced key management.
feat: Added Cache CLI commands providing command-line interface for all cache operations.
Complete CLI implementation with commands:
cache set,cache get,cache mset,cache mget,cache delete,cache exists,cache expire,cache ttl,cache ping,cache flush-pattern, andcache flush-tenant.Comprehensive help documentation and error handling for all commands.
v1.17.1
fix: Pin the version of click to 8.1.7
v1.17.0
feat: Allow optional
namespace_metadataandnamespace_descriptionfields in both the Publish Metric and Publish Collection endpoints.feat: Expose
descriptionandmetadatain the Get Namespaces API response.feat: Added Update Namespace functionality to modify a namespace’s description and metadata.
feat: Add search and filter capabilities to the Get Metrics endpoint.
fix: Make the
measuresparameter optional in the Query function.
v1.16.1
feat: Introduced the Block Swap feature, enabling the inclusion or exclusion of individual blocks within an app during both deployments and revision cycles.
v1.16.0
feat: Added support for
pauseandresumeworkflows through SDK and CLI.feat: Added workflow logs support for new peak infrastructure setup for supporting multi account orchestration.
v1.15.1
fix: Add back STAGE env variable for backward-compatibility.
v1.15.0
feat: Added support for conditional parameters.
feat: Added v2 function to update runtime block and app parameters.
feat: For using SDK and CLI, users can now set the
PEAK__STAGEenvironment variable to switch between different stages likedevorprod. It defaults toprod. Note that previouslySTAGEenvironment variable was used to achieve the same, but now it has been changed toPEAK__STAGEto avoid conflicts with other environment variables.
v1.14.0
feat: Added support for adding attachments when sending email.
feat: The create-artifact function now provides option to validate and scan the uploaded file for viruses.
v1.13.0
feat: Added support for App Parameters, enabling users to define a parameter once and use it across multiple blocks within an app. This allows users to pass the parameter value during deployment and at runtime in a single location, rather than specifying it individually in each block.
v1.12.0
feat: Peak SDK now officially supports Python 3.11 and 3.12 🌟
feat: Add function to publish metrics for a tenant.
feat: Add function to list published metrics for a tenant.
feat: Add function to query published metrics for a tenant.
feat: Add function to delete published metrics for a tenant.
feat: Add function to create metrics collection for a tenant.
feat: Add function to delete metrics collection for a tenant.
feat: Add function to list metric collections for a tenant.
feat: Add retries in SDK handler for API calls.
v1.11.0
feat: Added support for default values in parameters of type
object_array.
v1.10.0
feat: Added support for
http,sqlandexportsteps in workflows.This new feature enables users to execute HTTP requests, SQL queries and export data to a file as part of their workflows.
This feature is available in both the SDK and CLI as part of
Workflowresource as well asPress.
v1.9.0
feat: Add functions to get credentials for tenant data stores.
v1.8.0
feat: Added the support in SDK and CLI to redeploy failed apps or blocks deployments.
feat: Introduced the ability to upload Markdown(.md) and text(.txt) files for release and revision notes during the creation of block and app specs and deployments.
fix: Upgraded
typerversion to0.12.3. This fixes the issue where the CLI was not working with the latest version offastapi.chore: Updated the CLI dry-run output to be more readable.
fix: Output of CLI wasn’t properly formatted JSON. This has now been fixed.
fix: Usage commands in the CLI reference doc.
fix:
autoRunOnDeploywas not being set in the block spec when creating a block spec or release through the CLI. This has now been fixed.
v1.7.0
feat: Added support for executing resources like workflows on successful deployments of apps or blocks.
While creating block spec, we can specify the
autoRunOnDeploywhich can be set totrueto trigger the workflow execution on successful deployment of the block.While creating app spec, we can specify the
autoRunOnDeployfor each of the blocks in the config. This will trigger the execution of the those resources on successful deployment of the app.
v1.6.0
breaking: Refactored
get_loggerfrompeak.tools.loggingto now accept user-defined log processors viacustom_processors_factoryparameter, this allows users to define their own log processors and pass them to the logger, this also changes the signature ofget_loggerto acceptcustom_processors_factoryas a parameter, and dropspretty_printparameter as it is no longer needed and automatically inferred from the system environment, when not using an explicitcustom_processors_factory.structlog.processors.EventRenamer("message")is also automatically added to the processors list if not already present in the user-defined processors returned fromcustom_processors_factory.orjsonis now used as the default JSON serializer for the logger whencustom_processors_factoryis not provided.DEFAULT_SHARED_PROCESSORS,LOG_LEVEL_NAMES_TO_LOG_LEVEL,LOG_LEVEL_TO_LOG_LEVEL_NAMES,default_processors_factoryandpeak_contexts_processorsare now also exposed in thepeak.tools.loggingmodule for users to use in their implementations.
feat: Added email notification functionality to the SDK and CLI.
This new feature enables users to send email notifications to the valid recipients.
Workflow watchers can now receive email notifications for workflow executions.
feat: Users can now select the number of instances that would run for a service while creating or updating them.
fix: Fixed an issue due to which the
list_spec_release_deploymentsmethod was not working as expected in SDK and CLI.feat: List workflow executions can now be filtered by execution status.
v1.5.0
breaking: Refactored
get_loggerfrompeak.tools.loggingto now accept user-defined log processors viacustom_processors_factoryparameter, this allows users to define their own log processors and pass them to the logger.structlog.processors.EventRenamer("message")is also automatically added to the processors list if not already present in the user-defined processors returned fromcustom_processors_factory.orjsonis now used as the default JSON serializer for the logger whencustom_processors_factoryis not provided.DEFAULT_SHARED_PROCESSORS,LOG_LEVEL_NAMES_TO_LOG_LEVEL,LOG_LEVEL_TO_LOG_LEVEL_NAMES,default_processors_factoryandpeak_contexts_processorsare now also exposed in thepeak.tools.loggingmodule for users to use in their implementations.
feat: Added permission checking functionality to the SDK and CLI as part of the User resource.
This new feature enables users to verify their permissions for specific operations within a tenant’s web application.
The SDK includes
check_permissionsmethod, and the CLI includescheck_permissioncommand to facilitate this.
docs: Updated the documentation to include the new
Userresource.
v1.4.0
feat: Introduced new feature
Servicein Peak SDK and CLI where you can manage bothWeb AppsandAPI Deploymentsfrom a single place.Servicesupports all the functionalities of theWebappfeature with additional support forserviceType,entrypointandhealthCheckURL.A new function and command for testing API type services is also added.
docs: Updated SDK and CLI documentation to include the new
Serviceresource.docs: Reorganized the SDK and CLI documentation structure, aiming for improved navigability and organization.
docs: Updated the documentation theme, providing a more modern and accessible user experience.
docs: Introduced support for multiversion documentation, allowing users to easily access and navigate between different versions of the documentation.
fix: Issue with description not being optional when loading template.
note: The functionalities provided through the
Webappfeature in both Peak SDK and CLI are deprecated and will eventually be removed.This change aims to enhance our offering by consolidating features under the
Servicefeature, which offers a more comprehensive and flexible solution for managing web applications and API deployments.We strongly encourage users to start transitioning to the
Servicefeature to take full advantage of its capabilities, including support forserviceType,parameters,entrypointandhealthCheckURL.Further details on leveraging its functionalities will be provided in our documentation.
chore: Updated the development branch flow. Now instead of creating
developmentbranch frommainas release candidate, we will create separate version branches like12.10.10frommain.
v1.3.0
feat: Introduced the ability to upload Markdown(.md) and text(.txt) files for descriptions during the creation of block and application specs and deployments. This enhancement facilitates richer and more structured documentation directly within your spec or deployment.
feat Introduced a helper function to Press Block Deployments to allow a Block’s source code to access sibling Blocks within an App
docs: The documentation to include examples for executing new functionalities via the CLI, providing users with clear, actionable guidance on how to leverage these updates effectively.
docs: amended docs around Press parameters
docs: Enhanced the documentation to cover new features supported by the CLI, notably:
The option to specify a file for the –desc-file property, enabling more detailed and formatted descriptions for blocks and apps.
chore: Upgraded version of structlog to v24.1.0.
docs: Fixed documentation error, and adding cli & complete examples
docs: SDK examples for creating block/app deployment revisions
v1.2.1
chore: Improved the regex to match PII and other sensitive data in log records.
feat: Added option to disable data masking in logs records.
docs: Updated documentation with example of disabling data masking in logs records.
docs: Updated documentation for new workflow features. Workflow SDK and CLI now supports the following:
Skippable workflow steps
Workflow step auto-retries
Conditional execution of workflow steps
v1.2.0
feat: Add support for Press Deployment Revisions:
create-deployment-revisiondescribe-deployment-revisionlist-deployment-revisionscommands are now available on both
BlocksandApps. A Revision is created by specifying a differentreleaseversionof the spec currently deployed, along with anyrevisionnotesorparameters
feat: Add support for Press Build Parameters
Build parameters can be defined in the block spec while creating a new block spec or new block spec release, by adding a property of
buildwithin theparametersdict, and the desired parts of theconfigsection should also be parameterized using@param:PARAM_NAMEsyntax.Values for build parameters can then be provided while creating the app or block deployment or revision
Build parameter properties follow the same rules as runtime parameters
docs: Updated some docs around Press
v1.1.0
feat: All commands now support
--outputoption. This allows you to see the output in eitherjson,yaml, ortableformat.feat: Add
--dry-runoption to commands. This allows you to see API calls that the function makes along with the parameters that are sent.feat: Add
--pagingoption to commands. This allows you to see the response in a pager instead of dumping it all into the terminal at once.feat: Add new resource namely
tenantswhich now supportslist-instance-optionsbyentity-type.feat: The logging sub-package has been added to peak-sdk under peak/tools - To import logging, just run the following command
python from peak.tools import logging from peak.tools.logging import PeakLogger- To instantiate the logger, run the following commandpython logger: PeakLogger = logging.get_logger()- To use the logger, run the following commandpython logger.info("some info message")feat: A new function
delete_versionsis available insideimagesresource. This allows you to delete many versions at once, using a single call.breaking: The
delete_imagefunction now does what the name suggests - delete the complete image including all the versions in the image rather than deleting just the latest version as it used to do.feat: Parameterization is now supported in Press via SDK and CLI. It allows to pass parameters to the resources at runtime which can be used to change the runtime behaviour of the resource.
Runtime parameters can be defined in the block spec while creating a new block spec or new block spec release.
Initial values for parameters can be provided while creating the app or block deployment.
patch_parametersfunction is added which can be used to update the parameter values of a block deployment.get_parametersfunction is added which can be used to get the parameter values of a block deployment.
fix: Fixed an issue with
nullvalues being passed as values if keys in yaml files have empty value.feat: Users can now add
instanceTypeIdto webapp resource and webapp blocks. Webapp now also supports sticky sessions which we can enable by passingsessionStickinessasTruein the webapp resource and webapp block. Enabling session stickiness will tie each user to a specific server for all their requests.feat: Users can now view the status and details (like - step’s run status, step’s outputs, etc) about workflow executions via the SDK and CLI.
feat: Users can now view and download logs for images and workflow steps through SDK and CLI.
While viewing logs in CLI, users can pass
--followto view the live logs that are updated automatically.Users also have an option to save the logs to a file by using
--saveoption.
feat: Add favicon to SDK and CLI docs.
feat: While creating or updating images or image-versions,
buildDetailsandsourceis now optional for user’s convenience. By default,sourcewill be set toupload.feat: Users can now use
--generateoption with any command that requires a yaml file. This will generate a sample yaml file with all the required fields with sample values. This can be very helpful when you want to create a resource using the CLI, but don’t want to write the YAML config file yourself.
v1.0.0
feat: Peak SDK is now available on PyPi. 🚀
feat: The package has been rebranded as peak-sdk and now comes with a built-in CLI, eliminating the need for separate installation steps.
To install the SDK and the CLI, just run the following command
pip install peak-sdkTo install directly from GitHub, run the following command
pip install "peak-sdk @ git+https://github.com/PeakBI/peak-sdk.git@{branch-name-or-tag}"
feat: Users can now search worflows, images, and versions by passing in their name in the list functions. This will return a list of all the resources that contain the passed value in its name.
feat: Yaml file for creating or updating images or webapps is now optional. We can now pass all the required information as arguments to the CLI command.
feat: Add
create-or-updatecommands/functions in SDK/CLI resources. This allows us to update an existing workflow or create it if it does not exist.feat Added function and command -
patch-workflow. With the help of this, we can just pass the required parameters to update a workflow without need of yaml file.docs: Usage examples for Press SDK have been added.
v0.0.6
fix: Issue with environment variables where characters are getting autoescaped is fixed (#218).
breaking: Updated the format of the “release” key from a string value to an object with a nested “version” property to provide more flexibility and clarity in specifying the release version. Documentation is updated to reflect the changes.
release: { version: "0.0.1"; }
v0.0.5
ci: Updated and Published SDK and CLI docs to https://docs.peak.ai/sdk/latest.
feat: Added versioning support to image
list-buildsfunction. We can now filter image builds on versions and build status.chore: Added API doc links to all SDK functions.
fix: Examples for using templates are fixed (#226).
feat: Webapp blocks are now supported in Press SDK and CLI.
v0.0.4
feat: add progress bar in CLI and SDK for artifact compression.
refactor: [CLI] pass client object in click context instead of creating it inside every command file.
feat: Add support for passing parameters while executing workflows.
feat: Send source information (whether call is made from SDK or CLI) in telemetry data.
breaking: SDK/CLI for Press Apps now supports new Press APIs.
breaking: An App Spec must now be made up of already existing block specs by giving block config info in request body.
breaking: The
featuredfield has been removed from the spec definition and is now defined at the root when creating a spec.added: Users can now share specs across different tenants so they can be viewed/deployed outside of the tenant they were created in.
breaking: Removed
list-revisionsandcreate-revisionfor Apps deployments. These will be added back soon in upcoming release.
breaking: SDK/CLI for Press Blocks now supports new Press APIs which adds support for image versioning as well.
added: Blocks are now generic.
added: Users can now share specs across different tenants so they can be viewed/deployed outside of the tenant they were created in.
breaking: archive and unarchive functions for blocks are removed. We can now use
update_spec_metadatato update the spec status.breaking: To create a new block spec release, instead of using
update_spec, we can now usecreate_releaseSDK function.added:
update_spec_metadatais added which can be used to update metadata and discoverability of the spec.breaking: Removed
list-revisionsandcreate-revisionfor Blocks deployments. These will be added back soon in upcoming release.
added: Generic list/search functions and commands are added in Press SDK/CLI which will return specs/deployments of any kind (app or block).
breaking:
ignore_files_globis not supported when passing artifact information. It is replaced withignore_fileswhich takes in list of ignorefiles.ci: update branch name regex to support more patterns.
v0.0.3
fix:
update(patch)command forresources.imageservice works with all arguments as optional.fix: updated types in
sdktopython >= 3.10[PEP-585+], fixed lingering type issues inlistmethods and allsdkmethods.refactor: updated
listmethods insdkto return flattened list of items when usingauto-pagination.refactor: updated
RegistryHandlerand session methods to be more consistent and robust.refactor: changed
listclimethod names to avoid shadowing built-inlisttype.docs: revised examples to be in-line with current state of
sdkand updated types inexamples.docs: added sections on
auto-pagination,templateREFERENCES, and usage guides ontemplatingforsdkandcli.breaking:
typerenamed toimage_typeinresources.imageservice, fromtypeto avoid shadowing built-intype.tests: updated all tests and added new tests for missing scenarios, for 100% unit test coverage across
cliandsdk.ci: drop
typeguardfromdependenciesand stick withmypyfor type checking.ci: added
sonarqubefor code quality andcoveragereporting.ci: added
detect-secretsto prevent secrets from being committed to the repository.feat: SDK/CLI now supports
Image Managementv2 APIs, which adds support for versioning.breaking: In
createorupdatefunctions, we now need to pass the request details insidebodykey instead of directly passing them as arguments.added: You can now create image with source set to
dockerfileandgithubas well along withupload.breaking: We need to pass named arguments whenever any cli command needs 2 or more arguments.
breaking:
create(post)function is updated to support versioning. We now need to pass version as well in the request body.breaking:
update(patch)function is removed from bothsdkandcliandupdate-version(patch)is added.
feat: SDK/CLI
Workflowresources now supports image versions.feat: SDK/CLI now supports
Webappcreate, read, update, delete (CRUD) and list operations.feat: SDK/CLI now sends usage metrics to Peak. No sensitive/PII data is sent.
ci: fix github action to trigger pre-validate checks on correct conditions.