SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Nathaniel Cook
Increasing Reuse and
Time to Awesome by
Using Flux Packages
Write and share your Flux code
Flux Packages Coming Soon
© 2019 InfluxData. All rights reserved. 3
What are Flux packages?
● Flux source code
● Name
● Version
● Other Metadata
Anatomy of a Flux Package
© 2019 InfluxData. All rights reserved. 5
Create a Flux package
alerts/
package.flux
check.flux
notify.flux
// package.flux
package alerts
option package = {
version: "0.3.1",
dependencies: [{
package: "alerta",
version: "1.0.0"
}]
}
A package for consistently downsampling data across teams
Example: Consistent Downsampling
© 2019 InfluxData. All rights reserved. 7
Downsampling Package
//downsample.flux
package downsample
bucket = "downsampled_5m"
every = 5m
mean = (tables=<-) =>
tables
|> aggregateWindow(every: every, fn: mean)
|> set(key: "agg", value: "mean")
|> to(bucket: bucket)
© 2019 InfluxData. All rights reserved. 8
Package Tests
//downsample_test.flux
package downsample_test
import "downsample"
test mean = () => ({
input: ...,
want: ...,
fn: downsample.mean,
})
© 2019 InfluxData. All rights reserved. 9
Package
//package.flux
package downsample
option package = {
version: "0.3.1",
}
A package for monitoring services using the RED method
Example: RED Alerts
© 2019 InfluxData. All rights reserved. 11
RED Package
// red.flux
package red
import "influxdata/influxdb/monitoring"
requestsCheck = ...
errorsCheck = ...
durationsCheck = ...
© 2019 InfluxData. All rights reserved. 12
//package.flux
package red
option package = {
version: "0.32.1",
dependencies: [{
package: "influxdata/influxdb/monitor",
version: "1.0.0"
}]
}
Details on how packages function
Flux Package Mechanics
© 2019 InfluxData. All rights reserved. 14
Package Lookup
FLUX_PATH is an environment variable that defines a list of
directories to search for packages.
1. Search for directory of the form $FLUX_PATH/pauldix/foo
2. Search for version directory of the form
$FLUX_PATH/pauldix/foo/_version/v0.3.5
3. Search public registry for package (optionally download and
cache into FLUX_PATH)
© 2019 InfluxData. All rights reserved. 15
Dependency Resolution
What if the same dependency is used by more than one
dependent package?
Flux will pick the maximum version of the provided minimum
versions.
© 2019 InfluxData. All rights reserved. 16
Max of Mins Version Selection
package endpoints
option package = {
version: "1.5.1",
dependencies: [{
package: "alerta",
version: "1.2.1"
}]
}
package alerts
option package = {
version: "0.3.1",
dependencies: [{
package: "alerta",
version: "1.0.0"
}]
}
A short introduction
Semantic Versioning
© 2019 InfluxData. All rights reserved. 18
What is a semantic version?
v1.35.8
Major Minor Patch
© 2019 InfluxData. All rights reserved. 19
Major Versions
Different major versions of a package will be treated as a
separate package.
package foo
import "nathanielc/downsample"
import d2 "nathanielc/downsample@2"
A place to publish and share Flux packages
Flux Package Registry
© 2019 InfluxData. All rights reserved. 21
Package Registry
● User Account to authenticate with Registry
● Packages are Immutable
● Namespaced by a user or organization
● Semantically Versioned
© 2019 InfluxData. All rights reserved. 22
Influx CLI Utility
$ # Initialize a new package directory tree
$ influx package init
$ # Run all tests in the package directory
$ influx package test
$ # Publish the package to the registry
$ influx package publish
Flux is a
community
Let us know what you think about packages

Weitere ähnliche Inhalte

Was ist angesagt?

Itb2018 cf apps to dev to production with command box cf-config docker
Itb2018   cf apps to dev to production with command box cf-config dockerItb2018   cf apps to dev to production with command box cf-config docker
Itb2018 cf apps to dev to production with command box cf-config docker
Ortus Solutions, Corp
 
Apache web server
Apache web serverApache web server
Apache web server
zrstoppe
 

Was ist angesagt? (20)

Subversion Admin
Subversion AdminSubversion Admin
Subversion Admin
 
PHP development with Docker
PHP development with DockerPHP development with Docker
PHP development with Docker
 
"MagicBox" 16 - Codename Horn
"MagicBox" 16 - Codename Horn"MagicBox" 16 - Codename Horn
"MagicBox" 16 - Codename Horn
 
]project-open[ Package Manager
]project-open[ Package Manager]project-open[ Package Manager
]project-open[ Package Manager
 
Fluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API DetailsFluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API Details
 
Composer
ComposerComposer
Composer
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make files
 
Internationalizing Ubuntu apps
Internationalizing Ubuntu appsInternationalizing Ubuntu apps
Internationalizing Ubuntu apps
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
How to deploy PHP projects with docker
How to deploy PHP projects with dockerHow to deploy PHP projects with docker
How to deploy PHP projects with docker
 
$ make install
$ make install$ make install
$ make install
 
Fluentd v0.12 master guide
Fluentd v0.12 master guideFluentd v0.12 master guide
Fluentd v0.12 master guide
 
Fluentd Meetup 2016 - ServerEngine Integration & Windows support
Fluentd Meetup 2016 - ServerEngine Integration & Windows supportFluentd Meetup 2016 - ServerEngine Integration & Windows support
Fluentd Meetup 2016 - ServerEngine Integration & Windows support
 
Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014
 
Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with Ansible
 
Itb2018 cf apps to dev to production with command box cf-config docker
Itb2018   cf apps to dev to production with command box cf-config dockerItb2018   cf apps to dev to production with command box cf-config docker
Itb2018 cf apps to dev to production with command box cf-config docker
 
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...
 
Apache web server
Apache web serverApache web server
Apache web server
 
G rpc lection1
G rpc lection1G rpc lection1
G rpc lection1
 
Enterprise desktop at home with FreeIPA and GNOME
Enterprise desktop at home with FreeIPA and GNOMEEnterprise desktop at home with FreeIPA and GNOME
Enterprise desktop at home with FreeIPA and GNOME
 

Ähnlich wie Increasing Reuse and Time to Awesome by Using Flux Packages | Nathaniel Cook | InfluxData

Ähnlich wie Increasing Reuse and Time to Awesome by Using Flux Packages | Nathaniel Cook | InfluxData (20)

Oracle Solaris 11 - Best for Enterprise Applications
Oracle Solaris 11 - Best for Enterprise ApplicationsOracle Solaris 11 - Best for Enterprise Applications
Oracle Solaris 11 - Best for Enterprise Applications
 
FLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtFLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 Frankfurt
 
nullcon 2011 - Fuzzing with Complexities
nullcon 2011 - Fuzzing with Complexitiesnullcon 2011 - Fuzzing with Complexities
nullcon 2011 - Fuzzing with Complexities
 
Launch and Environment Constraints Overview
Launch and Environment Constraints OverviewLaunch and Environment Constraints Overview
Launch and Environment Constraints Overview
 
Intro to OSGi and Eclipse Virgo
Intro to OSGi and Eclipse VirgoIntro to OSGi and Eclipse Virgo
Intro to OSGi and Eclipse Virgo
 
Nuget is easier than you think and you should be using it as both a consumer ...
Nuget is easier than you think and you should be using it as both a consumer ...Nuget is easier than you think and you should be using it as both a consumer ...
Nuget is easier than you think and you should be using it as both a consumer ...
 
Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010
Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010
Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010
 
Dependency Management
Dependency ManagementDependency Management
Dependency Management
 
F3X12 FLOW3 Project Lifecycle
F3X12 FLOW3 Project LifecycleF3X12 FLOW3 Project Lifecycle
F3X12 FLOW3 Project Lifecycle
 
IPS: Image Packaging System
IPS: Image Packaging SystemIPS: Image Packaging System
IPS: Image Packaging System
 
VPN Monitoring Security Use Case Guide version 1.1
VPN Monitoring Security Use Case Guide version 1.1	VPN Monitoring Security Use Case Guide version 1.1
VPN Monitoring Security Use Case Guide version 1.1
 
Erp 2.50 openbravo environment installation openbravo-wiki
Erp 2.50 openbravo environment installation   openbravo-wikiErp 2.50 openbravo environment installation   openbravo-wiki
Erp 2.50 openbravo environment installation openbravo-wiki
 
Apache Kafka - Strakin Technologies Pvt Ltd
Apache Kafka - Strakin Technologies Pvt LtdApache Kafka - Strakin Technologies Pvt Ltd
Apache Kafka - Strakin Technologies Pvt Ltd
 
FFmpeg - the universal multimedia toolkit
FFmpeg - the universal multimedia toolkitFFmpeg - the universal multimedia toolkit
FFmpeg - the universal multimedia toolkit
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in Kubernetes
 
INFA intern showcase for Summer Project
INFA intern showcase for Summer ProjectINFA intern showcase for Summer Project
INFA intern showcase for Summer Project
 
Nginx reverse-proxy
Nginx reverse-proxyNginx reverse-proxy
Nginx reverse-proxy
 
Developing Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaDeveloping Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache Kafka
 
Piattaforma Web Linux completa dai sorgenti
Piattaforma Web Linux completa dai sorgentiPiattaforma Web Linux completa dai sorgenti
Piattaforma Web Linux completa dai sorgenti
 
Cohesive Networks Support Docs: VNS3:turret Base Container Guide
Cohesive Networks Support Docs: VNS3:turret Base Container GuideCohesive Networks Support Docs: VNS3:turret Base Container Guide
Cohesive Networks Support Docs: VNS3:turret Base Container Guide
 

Mehr von InfluxData

How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
InfluxData
 
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
InfluxData
 
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
InfluxData
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
InfluxData
 

Mehr von InfluxData (20)

Announcing InfluxDB Clustered
Announcing InfluxDB ClusteredAnnouncing InfluxDB Clustered
Announcing InfluxDB Clustered
 
Best Practices for Leveraging the Apache Arrow Ecosystem
Best Practices for Leveraging the Apache Arrow EcosystemBest Practices for Leveraging the Apache Arrow Ecosystem
Best Practices for Leveraging the Apache Arrow Ecosystem
 
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
 
Power Your Predictive Analytics with InfluxDB
Power Your Predictive Analytics with InfluxDBPower Your Predictive Analytics with InfluxDB
Power Your Predictive Analytics with InfluxDB
 
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
 
Build an Edge-to-Cloud Solution with the MING Stack
Build an Edge-to-Cloud Solution with the MING StackBuild an Edge-to-Cloud Solution with the MING Stack
Build an Edge-to-Cloud Solution with the MING Stack
 
Meet the Founders: An Open Discussion About Rewriting Using Rust
Meet the Founders: An Open Discussion About Rewriting Using RustMeet the Founders: An Open Discussion About Rewriting Using Rust
Meet the Founders: An Open Discussion About Rewriting Using Rust
 
Introducing InfluxDB Cloud Dedicated
Introducing InfluxDB Cloud DedicatedIntroducing InfluxDB Cloud Dedicated
Introducing InfluxDB Cloud Dedicated
 
Gain Better Observability with OpenTelemetry and InfluxDB
Gain Better Observability with OpenTelemetry and InfluxDB Gain Better Observability with OpenTelemetry and InfluxDB
Gain Better Observability with OpenTelemetry and InfluxDB
 
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
 
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
 
Introducing InfluxDB’s New Time Series Database Storage Engine
Introducing InfluxDB’s New Time Series Database Storage EngineIntroducing InfluxDB’s New Time Series Database Storage Engine
Introducing InfluxDB’s New Time Series Database Storage Engine
 
Start Automating InfluxDB Deployments at the Edge with balena
Start Automating InfluxDB Deployments at the Edge with balena Start Automating InfluxDB Deployments at the Edge with balena
Start Automating InfluxDB Deployments at the Edge with balena
 
Understanding InfluxDB’s New Storage Engine
Understanding InfluxDB’s New Storage EngineUnderstanding InfluxDB’s New Storage Engine
Understanding InfluxDB’s New Storage Engine
 
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDBStreamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
 
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
 
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
 
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

Increasing Reuse and Time to Awesome by Using Flux Packages | Nathaniel Cook | InfluxData

  • 1. Nathaniel Cook Increasing Reuse and Time to Awesome by Using Flux Packages
  • 2. Write and share your Flux code Flux Packages Coming Soon
  • 3. © 2019 InfluxData. All rights reserved. 3 What are Flux packages? ● Flux source code ● Name ● Version ● Other Metadata
  • 4. Anatomy of a Flux Package
  • 5. © 2019 InfluxData. All rights reserved. 5 Create a Flux package alerts/ package.flux check.flux notify.flux // package.flux package alerts option package = { version: "0.3.1", dependencies: [{ package: "alerta", version: "1.0.0" }] }
  • 6. A package for consistently downsampling data across teams Example: Consistent Downsampling
  • 7. © 2019 InfluxData. All rights reserved. 7 Downsampling Package //downsample.flux package downsample bucket = "downsampled_5m" every = 5m mean = (tables=<-) => tables |> aggregateWindow(every: every, fn: mean) |> set(key: "agg", value: "mean") |> to(bucket: bucket)
  • 8. © 2019 InfluxData. All rights reserved. 8 Package Tests //downsample_test.flux package downsample_test import "downsample" test mean = () => ({ input: ..., want: ..., fn: downsample.mean, })
  • 9. © 2019 InfluxData. All rights reserved. 9 Package //package.flux package downsample option package = { version: "0.3.1", }
  • 10. A package for monitoring services using the RED method Example: RED Alerts
  • 11. © 2019 InfluxData. All rights reserved. 11 RED Package // red.flux package red import "influxdata/influxdb/monitoring" requestsCheck = ... errorsCheck = ... durationsCheck = ...
  • 12. © 2019 InfluxData. All rights reserved. 12 //package.flux package red option package = { version: "0.32.1", dependencies: [{ package: "influxdata/influxdb/monitor", version: "1.0.0" }] }
  • 13. Details on how packages function Flux Package Mechanics
  • 14. © 2019 InfluxData. All rights reserved. 14 Package Lookup FLUX_PATH is an environment variable that defines a list of directories to search for packages. 1. Search for directory of the form $FLUX_PATH/pauldix/foo 2. Search for version directory of the form $FLUX_PATH/pauldix/foo/_version/v0.3.5 3. Search public registry for package (optionally download and cache into FLUX_PATH)
  • 15. © 2019 InfluxData. All rights reserved. 15 Dependency Resolution What if the same dependency is used by more than one dependent package? Flux will pick the maximum version of the provided minimum versions.
  • 16. © 2019 InfluxData. All rights reserved. 16 Max of Mins Version Selection package endpoints option package = { version: "1.5.1", dependencies: [{ package: "alerta", version: "1.2.1" }] } package alerts option package = { version: "0.3.1", dependencies: [{ package: "alerta", version: "1.0.0" }] }
  • 18. © 2019 InfluxData. All rights reserved. 18 What is a semantic version? v1.35.8 Major Minor Patch
  • 19. © 2019 InfluxData. All rights reserved. 19 Major Versions Different major versions of a package will be treated as a separate package. package foo import "nathanielc/downsample" import d2 "nathanielc/downsample@2"
  • 20. A place to publish and share Flux packages Flux Package Registry
  • 21. © 2019 InfluxData. All rights reserved. 21 Package Registry ● User Account to authenticate with Registry ● Packages are Immutable ● Namespaced by a user or organization ● Semantically Versioned
  • 22. © 2019 InfluxData. All rights reserved. 22 Influx CLI Utility $ # Initialize a new package directory tree $ influx package init $ # Run all tests in the package directory $ influx package test $ # Publish the package to the registry $ influx package publish
  • 23. Flux is a community Let us know what you think about packages