Deploy A Production Ready Kubernetes Cluster with Graphical interface

Breeze

  • Deploy a Production Ready Kubernetes Cluster with graphical interface

Note: Branches may be in an unstable or even broken state during development. Please use releases instead of those branches in order to get stable binaries.

Refer to User Guide for more details on how to use Breeze.

Breeze

Project Breeze is an open source trusted solution allow you to create Kubernetes clusters on your internal, secure, cloud network with graphical user interface. As a cloud native installer project, Breeze is listed in CNCF Cloud Native Interactive Landscape.

Breeze

Features

Easy to run: Breeze combines all resources you need such as kubernetes components images, ansible playbooks for the deployment of kubernetes clusters into a single docker image (wise2c/playbook). It also works as a local RHEL/CentOS yum and Ubuntu apt repository server. You just need a linux server with docker and docker-compose installed to run Breeze.

Simplified the process of kubernetes clusters deployment: With a few simple commands, you can get Breeze running, and then finish all the other deployment processes by the graphical interface.

Support offline deployment: After 5 images (playbook, yum-repo/apt-source, pagoda, deploy-ui) have been loaded on the deploy server, kubernetes clusters can be setup without internet access. Breeze works as a yum/apt repository server and deploys a local Harbor registry and uses kubeadm to setup kubernetes clusters. All docker images will be pulled from the local Harbor registry.

Support multi-cluster: Breeze supports multiple kubernetes clusters deployment.

Support high available architecture: With Breeze, you can setup kubernetes clusters with 3 master servers and 3 etcd servers combined with haproxy and keepalived. All worker nodes will use the virtual floating ip address to communicate with the master servers.

Architecture

Alt

Alt

Components

breeze: Ansible playbook for deployments of docker, harbor, haproxy+keepalived, etcd, kubernetes.

yum-repo: RHEL/CentOS yum repository for docker, docker-compose, kubelet, kubectl, kubeadm, kubernetes-cni etc,.

apt-source: Ubuntu apt source repository for docker, docker-compose, kubelet, kubectl, kubeadm, kubernetes-cni etc,.

deploy-ui: Graphical user interface.

pagoda: Server offers the API to operate Ansible playbooks.

kubeadm-version: Get k8s components images version list by command "kubeadm config"

Install & Run

System requirements:

Deploy server: docker 1.13.1+ and docker-compose 1.12.0+ .

Kubernetes cluster server: RHEL/CentOS/OracleLinux 7.4+ or RHEL/CentOS/RockyLinux/AlmaLinux/OracleLinux 8.4+ or Ubuntu 18/20 LTS is required and minimal installation mode is recommended.

Refer to User Guide for more details on how to use Breeze.

Community

  • Slack: Join Breeze's community for discussion and ask questions: Breeze Slack, channel: #general

Download Details:

Author: wise2c-devops
Source Code: https://github.com/wise2c-devops/breeze

License: Apache-2.0 license

#kubernetes 

Deploy A Production Ready Kubernetes Cluster with Graphical interface

General: The Official Registry Of General Julia Packages

General

General is the default Julia package registry. Package registries are used by Julia's package manager Pkg.jl and includes information about packages such as versions, dependencies and compatibility constraints.

The General registry is open for everyone to use and provides access to a large ecosystem of packages.

If you are registering a new package, please make sure that you have read the package naming guidelines.

Follow along new package registrations with the #new-packages-feed channels in the community Slack or Zulip!

See our Contributing Guidelines for ways to get involved!

Registering a package in General

New packages and new versions of packages are added to the General registry by pull requests against this GitHub repository. It is highly recommended that you use Registrator.jl to automate this process. Registrator can either be used as a GitHub App or through a web interface, as decribed in the Registrator README.

When Registrator is triggered a pull request is opened against this repository. Pull requests that meet certain guidelines is merged automatically, see Automatic merging of pull requests. Other pull requests need to be manually reviewed and merged by a human.

It is highly recommended to also use TagBot, which automatically tags a release in your repository after the new release of your package is merged into the registry.

Registered packages must have an Open Source Initiative approved license, clearly marked via a LICENSE.md, LICENSE, COPYING or similarly named file in the package repository. Packages that wrap proprietary libraries are acceptable if the licenses of those libraries permit open source distribution of the Julia wrapper code.

Automatic merging of pull requests

Pull requests that meet certain criteria are automatically merged periodically. Only pull requests that are opened by Registrator are candidates for automatic merging.

The full list of AutoMerge guidelines is available in the RegistryCI documentation.

Please report issues with automatic merging to the RegistryCI repo.

Currently the waiting period is as follows:

  • New Julia packages: 3 days (this allows time for community feedback)
  • New versions of existing packages: 15 minutes
  • JLL package (binary dependencies): 15 minutes, for either a new package or a new version

FAQ

Do I need to register a package to install it?

No, you can simply do using Pkg; Pkg.add(url="https://github.com/JuliaLang/Example.jl") or ] add https://github.com/JuliaLang/Example.jl in the Pkg REPL mode to e.g. install the package Example.jl, even if it was not registered. When a package is installed this way, the URL is saved in the Manifest.toml, so that file is needed to resolve Pkg environments that have unregistered packages installed.

Registering allows the package to be added by Pkg.add("Example") or ] add Example in the Pkg REPL mode. This is true if the package is installed in any registry you have installed, not just General; you can even create your own registry!

Should I register my package?

If your package might be useful to others, or provide functionality other packages in General might want to rely on, go for it! We only ask that you consider the following best practices.

  • It is easier for others to use your package if it has documentation that explains what the package is for and how to use it. This could be in the form of a README or hosted documentation such as that generated by Documenter.jl.
  • And in order to provide reliable functionality for your users, it is also important to setup tests (see the Pkg.jl docs and the Test stdlib docs), which can be automatically run by free continuous integration services such as GitHub Actions.
  • Also, note that the General registry is not a place for "personal packages" that consist of collections of "utility functions" nor for packages that are only useful for a closed group (like a research group or a company). For that, it is easy to set up your own registry using for example LocalRegistry.jl. The Pkg documentation about registries might be useful if you decide to go this route.

Packages like PkgTemplates.jl or PkgSkeleton.jl provide easy ways to setup documentation, tests, and continuous integration.

My pull request was not approved for automatic merging, what do I do?

It is recommended that you fix the release to conform to the guidelines and then retrigger Registrator on the branch/commit that includes the fix.

If you for some reason can't (or won't) adhere to the guidelines you will have to wait for a human to review/merge the pull request. You can contact a human in the #pkg-registration channel in the official Julia Slack to expedite this process.

My package fails to load because it needs proprietary software/additional setup to work, what can I do?

Before merging a pull request, AutoMerge will check that your package can be installed and loaded. It is OK for your package to not be fully functional, but making it at least load successfully would streamline registration, as it does not require manual intervention from the registry maintainers. This would also let other packages depend on it, and use its functionalities only when the proprietary software is available in the system, as done for example by the CUDA.jl package. If you are not able or willing to make your package always loadable without the proprietary dependency (which is the preferred solution), you can check if the environment variable JULIA_REGISTRYCI_AUTOMERGE is equal to true and make your package loadable during AutoMerge at least, so that it can be registered without manual intervention. Examples of packages with proprietary software that use the environment variable check include Gurobi.jl and CPLEX.jl.

My pull request has a merge conflict, what do I do?

Retrigger Registrator.

How do I retrigger Registrator in order to update my pull request?

Do what you did when you triggered Registrator the first time.

AutoMerge is blocked by one of my comments, how do I unblock it?

Simply edit [noblock] into all your comments. AutoMerge periodically checks each PR, and if there are no blocking comments when it checks (i.e. all comments have [noblock] present), it will continue to merge (assuming of course that all of its other checks have passed).

Are there any requirements for package names in the General registry?

There are no hard requirements, but it is highly recommended to follow the package naming guidelines.

What to do when asked to reconsider/update the package name?

If someone comments on the name of your package when you first release it it is often because it does not follow the naming guidelines. If you think that your package should not follow those conventions for some reason or another, just explain why. Otherwise, it is often a good idea to just rename the package -- it is more disruptive to do so after it is already registered, and sticking to the conventions makes it easier for users to navigate Julia's many varied packages.

As long as the package is not yet registered, renaming the package from OldName.jl to NewName.jl is reasonably straightforward:

  • Rename the GitHub repository to NewName.jl
  • Rename the file src/OldName.jl to src/NewName.jl
  • Rename the top-level module to NewName
  • Update tests, documentation, etc, to reference the new name
  • Once you are done renaming the package, retrigger registration. This will make a new pull request to General. It is helpful to comment in the old pull request that it can be closed, linking to the new one.

How do I rename an existing registered package?

Technically, you can't rename a package once registered, as this would break existing users. But you can re-register the package again under a new name with a new UUID, which basically has the same effect.

  • Follow the instructions above for renaming a package: rename on GitHub, rename files etc.
    • if you rename the repository so it has a new URL, make a PR to edit the URL stored in the registry for the old package name to point to the new URL (example). This allows the old versions of the package under the previous name to continue to work.
  • Generate a new UUID for the Project.toml
  • Increment the version in the Project.toml as a breaking change.
  • Register it as if it were a new package
  • Comment on the PR, that this is a rename.
  • It will have to go though the normal criteria for registring a new package.
    • In particular, even if you get it merged manually, it will need to wait 3 days from the PR being opened.
    • This gives others and yourself the chance to point out any naming issues.

You also should let your users know about the rename, e.g. by placing a note in the README, or opening PRs/issues on downstream packages to change over.

How do I transfer a package to an organization or another user?

Technically if you skip the second step things will keep working, because GitHub will redirect; but it is best practice. For this reason, when you try to register a new release, the Julia Registrator will complain if the second step is skipped.

Where do I report a problem with a package in the General registry?

Report it to the package repository.

How do I remove a package or version from the registry?

You can't. Package registrations are permanent. A version can not be overwritten in the registry, and code cannot be deleted.

Can my package be registered without an OSI approved license?

No, sorry. The registry is maintained by volunteers, and we don't have a legal team who can thoroughly review licenses. It is very easy to accidentally wander into legally murky territory when combining common OSI licenses[^1] like GPL with non-OSI licenses and we don't want to subject Julia users to that risk when installing packages registered in General. See these [comments] (https://github.com/JuliaRegistries/General/pull/31549#issuecomment-804196208) for more discussion. We are not lawyers and this is not legal advice.

[^1]: Note that even within the world of OSI licenses, there are combinations of OSI licenses which are not legal to use together, such as GPL2 with Apache2.

Registry maintenance

The General registry is a shared resource that belongs to the entire Julia community. Therefore, we welcome comments and suggestions from everyone in the Julia community. However, all decisions regarding the General registry are ultimately up to the discretion of the registry maintainers.

See our Contributing Guidelines for ways to get involved!

Disclaimer

The General registry is open for everyone to register packages in. The General registry is not a curated list of Julia packages. In particular this means that:

  • packages included in the General registry are not reviewed/scrutinized;
  • packages included in the General registry are not "official" packages and not endorsed/approved by the JuliaLang organization;
  • the General registry and its maintainers are not responsible for the package code you install through the General registry -- you are responsible for reviewing your code dependencies.
WorkflowStatus
AutoMergeAutoMerge status
Continuous Integration (CI)Continuous Integration (CI) status
TagBot TriggersTagBot Triggers status
Update ManifestsUpdate Manifests status

Download Details:

Author: JuliaRegistries
Source Code: https://github.com/JuliaRegistries/General 
License: MIT license

#julia #general 

General: The Official Registry Of General Julia Packages

Bibliography.jl: General Bibliography Manager in Pure Julia

Bibliography.jl

Bibliography.jl is a Julia package for handling both import/export from various bibliographic formats.

Short documentation

# Import a BibTeX file to the internal bib structure
imported_bib = import_bibtex(source_path::AbstractString)


# Select a part of a bibliography
selection = ["key1", "key2"]
selected_bib = select(imported_bib, selection) # select the intersection between the bibliography and `selection`
diff_bib = select(imported_bib, selection; complementary = true) # select the difference between the bibliography and `selection`

# Export from internal to BibTeX format
export_bibtex(target_path::AbstractString, bibliography)

# Check BibTeX rules, entry validity, clean and sort a bibtex file
export_bibtex(target_path::AbstractString, import_bibtex(path_to_file::AbstractString))

# Export from internal to the Web Format of StaticWebPages.jl
export_web(bibliography)

# Export from BibTeX to the Web Format of StaticWebPages.jl
bibtex_to_web(source_path::AbstractString)

Organization

This package comes as a set of 3 packages to convert bibliographies. This tool was split into three for the sake of the precompilation times.

  • Bibliography.jl: The interface to import/export bibliographic items.
  • BibInternal.jl: A julian internal format to translate from and into.
  • BibParser.jl: A container for different bibliographic format parsers (such as BibTeX).

Packages using Bibliographies

  • StaticWebPages.jl: a black-box generator for static websites oriented towards personal and/or academic pages. No knowledge of Julia nor any other programming language is required.

Contributions are welcome

  • Write new or integrate existing parsers to BibParser.jl (currently only a light BibTeX parser is available).
  • Add import/export from existing bibliographic formats to Bibliography.jl.
  • Add export for non-bibliographic formats (such as in StaticWebPages.jl).

Download Details:

Author: Humans-of-Julia
Source Code: https://github.com/Humans-of-Julia/Bibliography.jl 
License: MIT license

#julia #general 

Bibliography.jl: General Bibliography Manager in Pure Julia
Royce  Reinger

Royce Reinger

1658458920

Ruby, Command-line Client for The Slack Web, Real Time Messaging APIs

Slack Ruby Client  

A Ruby client for the Slack Web, RealTime Messaging and Events APIs. Comes with a handy command-line client, too. If you are not familiar with these concepts, you might want to watch this video.

Useful to Me?

  • This library will let you send messages to Slack via the Web API, send and receive messages via the Real Time Messaging API and facilitate integration with the Events API.
  • To respond to slash commands, interactive components or events, implement a web application using your favorite web framework and use this library to call the Slack Web API and to verify that events are coming from Slack.
  • To build a bot using the Real Time Messaging API, use slack-ruby-bot, which uses this library.
  • To roll out a complete service using the Real Time Messaging API with Slack button integration to multiple teams, check out slack-ruby-bot-server, which is built on top of slack-ruby-bot, which uses this library.

Stable Release

You're reading the documentation for the next release of slack-ruby-client. Please see the documentation for the last stable release, v1.0.0 unless you're integrating with HEAD. See UPGRADING when upgrading from an older version.

Installation

Add to Gemfile.

gem 'slack-ruby-client'

If you're going to be using the RealTime client, add async-websocket. See below for more information about concurrency.

gem 'async-websocket', '~> 0.8.0'

Run bundle install.

Usage

Create a New Bot Integration

To integrate your bot with Slack, you must first create a new Slack App.

OAuth Code Grant

Once created, go to the app's Basic Info tab and grab the Client ID and Client Secret. You'll need these in order complete an OAuth code grant flow as described at slack-ruby-bot-server.

Using the Legacy API Token

Although OAuth is recommended, you can still generate a legacy API token for your app and use it for some interactions.

Slack.configure do |config|
  config.token = ENV['SLACK_API_TOKEN']
end

This sets a global default token. You can also pass a token into the initializer of both Slack::Web::Client and Slack::RealTime::Client or configure those separately via Slack::Web::Config.configure and Slack::RealTime::Config.configure. The instance token will be used over the client type token over the global default.

Global Settings

The following global settings are supported via Slack.configure.

settingdescription
tokenSlack API token.
loggerAn optional logger, defaults to ::Logger.new(STDOUT) at Logger::WARN level.

Web Client

The Slack Web API allows you to build applications that interact with Slack.

Web Client Examples

Here are some examples of how to use the web client with the Web API.

Test Auth

client = Slack::Web::Client.new
client.auth_test

Send Messages

Send messages with chat_PostMessage.

client.chat_postMessage(channel: '#general', text: 'Hello World', as_user: true)

See a fully working example in examples/hi_web.

hi.gif

List Channels

List channels with conversations_list.

channels = client.conversations_list.channels

general_channel = channels.detect { |c| c.name == 'general' }

Upload a File

Upload a file with files_upload.

client.files_upload(
  channels: '#general',
  as_user: true,
  file: Faraday::UploadIO.new('/path/to/avatar.jpg', 'image/jpeg'),
  title: 'My Avatar',
  filename: 'avatar.jpg',
  initial_comment: 'Attached a selfie.'
)

Get Channel Info

You can use a channel ID or name (prefixed with #) in all functions that take a :channel argument. Lookup by name is not supported by the Slack API and the channels_id method called invokes conversations_list in order to locate the channel ID.

client.conversations_info(channel: 'C04KB5X4D') # calls conversations_info
client.conversations_info(channel: '#general') # calls conversations_list followed by conversations_info

Get User Info

You can use a user ID or name (prefixed with @) in all functions that take a :user argument. Lookup by name is not supported by the Slack API and the users_id method called invokes users_list in order to locate the user ID.

client.users_info(user: 'U092BDCLV') # calls users_info
client.users_info(user: '@dblock') # calls users_list followed by users_info

Search for a User

Constructs an in-memory index of users and searches it. If you want to use this functionality, add the picky gem to your project's Gemfile.

client.users_search(user: 'dblock')

Other

Refer to the Slack Web API Method Reference for the list of all available functions.

Web Client Options

You can configure the Web client either globally or via the initializer.

Slack::Web::Client.configure do |config|
  config.user_agent = 'Slack Ruby Client/1.0'
end
client = Slack::Web::Client.new(user_agent: 'Slack Ruby Client/1.0')

The following settings are supported.

settingdescription
tokenSlack API token.
user_agentUser-agent, defaults to Slack Ruby Client/version.
proxyOptional HTTP proxy.
ca_pathOptional SSL certificates path.
ca_fileOptional SSL certificates file.
endpointSlack endpoint, default is https://slack.com/api.
loggerOptional Logger instance that logs HTTP requests.
timeoutOptional open/read timeout in seconds.
open_timeoutOptional connection open timeout in seconds.
default_page_sizeOptional page size for paginated requests, default is 100.
default_max_retriesOptional number of retries for paginated requests, default is 100.
adapterOptional HTTP adapter to use, defaults to Faraday.default_adapter.

You can also pass request options, including timeout and open_timeout into individual calls.

client.conversations_list(request: { timeout: 180 })

You can also control what proxy options are used by modifying the http_proxy environment variable per Net::HTTP's documentation.

Note that Docker on OSX seems to incorrectly set the proxy, causing Faraday::ConnectionFailed, ERROR -- : Failed to open TCP connection to : (getaddrinfo: Name or service not known). You might need to manually unset http_proxy in that case, eg. http_proxy="" bundle exec ruby ./my_bot.rb.

Pagination Support

The Web client natively supports cursor pagination for methods that allow it, such as users_list. Supply a block and the client will make repeated requests adjusting the value of cursor with every response. The default limit is set to 100 and can be adjusted via Slack::Web::Client.config.default_page_size or by passing it directly into the API call.

all_members = []
client.users_list(presence: true, limit: 10) do |response|
  all_members.concat(response.members)
end
all_members # many thousands of team members retrieved 10 at a time

When using cursor pagination the client will automatically pause and then retry the request if it runs into Slack rate limiting. (It will pause according to the Retry-After header in the 429 response before retrying the request.) If it receives too many rate-limited responses in a row it will give up and raise an error. The default number of retries is 100 and can be adjusted via Slack::Web::Client.config.default_max_retries or by passing it directly into the method as max_retries.

You can also proactively avoid rate limiting by adding a pause between every paginated request with the sleep_interval parameter, which is given in seconds.

all_members = []
client.users_list(presence: true, limit: 10, sleep_interval: 5, max_retries: 20) do |response|
  # pauses for 5 seconds between each request
  # gives up after 20 consecutive rate-limited responses
  all_members.concat(response.members)
end
all_members # many thousands of team members retrieved 10 at a time

Character Encoding

Note that Slack expects text to be UTF-8 encoded. If your messages appear with text such as BAD+11 in Slack, check text.encoding and .encode(Encoding::UTF_8) your messages before sending them to Slack.

text = 'characters such as "Ñ", "Á", "É"'
text.encoding
=> #<Encoding:UTF-8>
client.chat_postMessage(channel: '#general', text: text, as_user: true)
# renders 'characters such as "Ñ", "Á", "É"' in Slack

text = text.encode(Encoding::ISO_8859_1)
text.encoding
# => #<Encoding:ISO-8859-1>
client.chat_postMessage(channel: '#general', text: text, as_user: true)
# renders 'characters such as "BAD+11", "", "BAD+9"' in Slack

Error Handling

Slack Errors

If Slack returns an error for the request, then an error will be raised. The error class is specific to the type of error that Slack returns. For instance if Slack returns account_inactive then the error will be Slack::Web::Api::Errors::AccountInactive. This allows you to handle certain types of errors as needed:

rescue Slack::Web::Api::Errors::AccountInactive => e
  # deal with inactive account
end

All of these errors inherit from Slack::Web::Api::Errors::SlackError, so you can handle or silence all errors if necessary:

rescue Slack::Web::Api::Errors::SlackError => e
  # capture all Slack errors
end

If there's a new error type that is not yet known by this library, then it will raise Slack::Web::Api::Errors::SlackError. (Update the Web API if you find that errors are missing — see CONTRIBUTING.)

In all of these cases the error message contains the error code, which is also accessible with slack_error.error. In case of multiple errors, the error message contains the error codes separated by commas, or they are accessible as an array with slack_error.errors. The original response is also accessible using the response attribute. The response_metadata is accessible with slack_error.response_metadata.

Rate Limiting

If you exceed Slack’s rate limits, a Slack::Web::Api::Errors::TooManyRequestsError will be raised instead. (This does not inherit from Slack::Web::Api::Errors::SlackError.)

Other Errors

When Slack is temporarily unavailable a subclass of Slack::Web::Api::Errors::ServerError will be raised and the original Faraday::Error will be accesible via exception.cause. (Starting with 0.18.0 this is no longer a subclass of Slack::Web::Api::Errors::SlackError.)

Specifically Slack::Web::Api::Errors::ParsingError will be raised on non-json response (i.e. 200 OK with Slack unavailable HTML page) and Slack::Web::Api::Errors::HttpRequestError subclasses for connection failures (Slack::Web::Api::Errors::TimeoutError for read/open timeouts & Slack::Web::Api::Errors::UnavailableError for 5xx HTTP responses).

In any other case, a Faraday::ClientError will be raised.

RealTime Client

The Real Time Messaging API is a WebSocket-based API that allows you to receive events from Slack in real time and send messages as user.

client = Slack::RealTime::Client.new

client.on :hello do
  puts "Successfully connected, welcome '#{client.self.name}' to the '#{client.team.name}' team at https://#{client.team.domain}.slack.com."
end

client.on :message do |data|
  case data.text
  when 'bot hi' then
    client.message(channel: data.channel, text: "Hi <@#{data.user}>!")
  when /^bot/ then
    client.message(channel: data.channel, text: "Sorry <@#{data.user}>, what?")
  end
end

client.on :close do |_data|
  puts "Client is about to disconnect"
end

client.on :closed do |_data|
  puts "Client has disconnected successfully!"
end

client.start!

You can send typing indicators with typing.

client.typing channel: data.channel

You can send a ping with ping.

client.ping

By default, the RealTime client exposes and maintains a local store with the properties of rtm.start upon a successful connection.

propertydescription
urlA WebSocket Message Server URL.
selfThe authenticated bot user.
teamDetails on the authenticated user's team.
usersA hash of user objects by user ID.
channelsA hash of channel objects, one for every channel visible to the authenticated user.
groupsA hash of group objects, one for every group the authenticated user is in.
imsA hash of IM objects, one for every direct message channel visible to the authenticated user.
botsDetails of the integrations set up on this team.

It also tracks changes, such as users being renamed, added or deleted, therefore client.users is always up-to-date.

Tracking with a local store can be disabled with Slack::RealTime::Client.new(store_class: nil). Other stores are also available.

Slack::RealTime::Stores::Store

The default store that tracks all changes. By default the client will be connected using rtm_start.

Slack::RealTime::Stores::Starter

A smaller store that only stores and tracks information about the bot user, but not channels, users, groups, ims or bots. By default the client will be connected using rtm_connect.

Configuring Slack::RealTime::Client

You can configure the RealTime client either globally or via the initializer.

Slack::RealTime::Client.configure do |config|
  config.websocket_ping = 42
end
client = Slack::RealTime::Client.new(websocket_ping: 42)

The following settings are supported.

settingdescription
tokenSlack API token.
websocket_pingHow long the socket can be idle before sending a ping message to confirm it's still connected, default is 30.
websocket_proxyConnect via proxy, include :origin and :headers.
store_classLocal store class name, default is an in-memory Slack::RealTime::Stores::Store.
start_methodOptional start method, either :rtm_start or :rtm_connect.
start_optionsOptions to pass into rtm.start or rtm.connect, default is { request: { timeout: 180 } }.
loggerOptional Logger instance that logs RealTime requests and socket data.

Note that the RealTime client uses a Web client to obtain the WebSocket URL via rtm.start or rtm.connect. While token and logger options are passed down from the RealTime client, you may also configure Web client options via Slack::Web::Client.configure as described above.

See a fully working example in examples/hi_real_time.

Caveats

websocket_ping

This setting determines how long the socket can be idle before sending a ping message to confirm it's still connected.

It's important to note that if a ping message was sent and no response was received within the amount of time specified in websocket_ping the client will attempt to reestablish it's connection to the message server.

Note that the ping may take between websocket_ping and websocket_ping * 3/2 seconds to actually trigger when there is no activity on the socket. This is because the timer that checks whether to ping is triggered at every websocket_ping / 2 interval.

To disable this feature set websocket_ping to 0.

Connection Methods

The RealTime client uses either rtm.start or rtm.connect to open a connection. The former retrieves a lot of team information while the latter only serves connection purposes and is preferred. You should let the library choose the right method for you based on the store_class used and override this behavior with start_method when necessary.

Slack::RealTime::Client.configure do |config|
  config.start_method = :rtm_start
end

Combining RealTime and Web Clients

Since the Web client is used to obtain the RealTime client's WebSocket URL, you can continue using the Web client in combination with the RealTime client.

client = Slack::RealTime::Client.new

client.on :message do |data|
  case data.text
  when 'bot hi' then
    client.web_client.chat_postMessage(channel: data.channel, text: "Hi <@#{data.user}>!")
  when /^bot/ then
    client.web_client.chat_postMessage(channel: data.channel, text: "Sorry <@#{data.user}>, what?")
  end
end

client.start!

See a fully working example in examples/hi_real_time_and_web.

hi.gif

Large Team Considerations

The rtm.start call downloads a large amount of data. For large teams, consider reducing the amount of unnecessary data downloaded with start_options. You may also want to increase the default timeout of 180 seconds.

Slack::RealTime::Client.configure do |config|
  # Return timestamp only for latest message object of each channel.
  config.start_options[:simple_latest] = true
  # Skip unread counts for each channel.
  config.start_options[:no_unreads] = true
  # Increase request timeout to 6 minutes.
  config.start_options[:request][:timeout] = 360
end

See #134 for a discussion on this topic.

Concurrency

Slack::RealTime::Client needs help from a concurrency library and supports Async.

Slack::RealTime.configure do |config|
  config.concurrency = Slack::RealTime::Concurrency::Async
end

Use client.start_async instead of client.start!. A good example of such application is slack-ruby-bot-server.

client = Slack::RealTime::Client.new

client.start_async

Async

Add async-websocket to your Gemfile.

gem 'async-websocket'

See a fully working example in examples/hi_real_time_async_async.

Events API

This library provides limited support for the Slack Events API.

Configuring Slack::Events

You can configure Events support globally.

Slack::Events.configure do |config|
  config.signing_secret = 'secret'
end

The following settings are supported.

settingdescription
signing_secretSlack signing secret, defaults is ENV['SLACK_SIGNING_SECRET'].
signature_expires_inSignature expiration window in seconds, default is 300.

Verifying the Request Signature

Slack signs its requests using a secret that's unique to your app. Verify incoming HTTP requests as follows.

slack_request = Slack::Events::Request.new(http_request)
slack_request.verify!

To specify secrets on a per-request basis:

Slack::Events::Request.new(http_request,
                           signing_secret: signing_secret,
                           signature_expires_in: signature_expires_in)

The verify! call may raise Slack::Events::Request::MissingSigningSecret, Slack::Events::Request::InvalidSignature or Slack::Events::Request::TimestampExpired errors.

Message Parsing

All text in Slack uses the same system of escaping: chat messages, direct messages, file comments, etc. Use Slack::Messages::Formatting to unescape incoming messages. This comes handy, for example, you want to treat all input to a real time bot as plain text.

Slack::Messages::Formatting.unescape('Hello &amp; &lt;world&gt;'))
  # => 'Hello & <world>'
Slack::Messages::Formatting.unescape('Hey <@U024BE7LH|bob>, did you see my file?'))
  # => 'Hey @bob, did you see my file?'
Slack::Messages::Formatting.unescape('Hey <@U02BEFY4U>'))
  # => 'Hey @U02BEFY4U'
Slack::Messages::Formatting.unescape('This message contains a URL <http://foo.com/>'))
  # => 'This message contains a URL http://foo.com/'
Slack::Messages::Formatting.unescape('So does this one: <http://www.foo.com|www.foo.com>'))
  # => 'So does this one: www.foo.com'
Slack::Messages::Formatting.unescape('<mailto:bob@example.com|Bob>'))
  # => 'Bob'
Slack::Messages::Formatting.unescape('Hello <@U123|bob>, say hi to <!everyone> in <#C1234|general>'))
  # => 'Hello @bob, say hi to @everyone in #general'
Slack::Messages::Formatting.unescape('Hello <@U123|bob> &gt; file.txt'))
  # => 'Hello @bob > file.txt'
Slack::Messages::Formatting.unescape('“hello”'))
  # => '"hello"'
Slack::Messages::Formatting.unescape('‘hello’'))
  # => "'hello'"

Command-Line Client

The slack command-line client returns JSON data from the Slack API.

Authenticate with Slack

$ slack --slack-api-token=[token] auth test
{"ok":true,"url":"...","team":"...","user":"...","team_id":"...","user_id":"..."}

Send a Message

export SLACK_API_TOKEN=...
$ slack chat postMessage --text="hello world" --channel="#general"
{"ok":true,"channel":"...","ts":"...","message":{"text":"hello world","username":"bot","type":"message","subtype":"bot_message","ts":"..."}}

Get Channel Id

$ slack channels id --channel=#general
{"ok":true,"channel":{"id":"C04KB5X4D"}}

Get Channel Info

$ slack channels info --channel=#general
{"ok":true,"channel":{"id":"C04KB5X4D","name":"general", ...}}

List Users

Combine with jq, a command-line JSON parser.

$ slack users list | jq '.members | map({(.id): .name})'
[
  {
    "U04KB5WQR": "dblock"
  },
  {
    "U07518DTL": "rubybot"
  }
]

See slack help for a complete command-line reference.

History

This gem is based on slack-ruby-gem, but it more clearly separates the Web and RTM APIs, is more thoroughly tested and is in active development.

Contributing

See CONTRIBUTING.

Author: dblock
Source Code: https://github.com/dblock/slack-ruby-client 
License: MIT license

#ruby #client #slack 

Ruby, Command-line Client for The Slack Web, Real Time Messaging APIs
Awesome  Rust

Awesome Rust

1654894080

Serde JSON: JSON Support for Serde Framework

Serde JSON

Serde is a framework for serializing and deserializing Rust data structures efficiently and generically.

[dependencies]
serde_json = "1.0"

You may be looking for:

JSON is a ubiquitous open-standard format that uses human-readable text to transmit data objects consisting of key-value pairs.

{
    "name": "John Doe",
    "age": 43,
    "address": {
        "street": "10 Downing Street",
        "city": "London"
    },
    "phones": [
        "+44 1234567",
        "+44 2345678"
    ]
}

There are three common ways that you might find yourself needing to work with JSON data in Rust.

  • As text data. An unprocessed string of JSON data that you receive on an HTTP endpoint, read from a file, or prepare to send to a remote server.
  • As an untyped or loosely typed representation. Maybe you want to check that some JSON data is valid before passing it on, but without knowing the structure of what it contains. Or you want to do very basic manipulations like insert a key in a particular spot.
  • As a strongly typed Rust data structure. When you expect all or most of your data to conform to a particular structure and want to get real work done without JSON's loosey-goosey nature tripping you up.

Serde JSON provides efficient, flexible, safe ways of converting data between each of these representations.

Operating on untyped JSON values

Any valid JSON data can be manipulated in the following recursive enum representation. This data structure is serde_json::Value.

enum Value {
    Null,
    Bool(bool),
    Number(Number),
    String(String),
    Array(Vec<Value>),
    Object(Map<String, Value>),
}

A string of JSON data can be parsed into a serde_json::Value by the serde_json::from_str function. There is also from_slice for parsing from a byte slice &[u8] and from_reader for parsing from any io::Read like a File or a TCP stream.

use serde_json::{Result, Value};

fn untyped_example() -> Result<()> {
    // Some JSON input data as a &str. Maybe this comes from the user.
    let data = r#"
        {
            "name": "John Doe",
            "age": 43,
            "phones": [
                "+44 1234567",
                "+44 2345678"
            ]
        }"#;

    // Parse the string of data into serde_json::Value.
    let v: Value = serde_json::from_str(data)?;

    // Access parts of the data by indexing with square brackets.
    println!("Please call {} at the number {}", v["name"], v["phones"][0]);

    Ok(())
}

The result of square bracket indexing like v["name"] is a borrow of the data at that index, so the type is &Value. A JSON map can be indexed with string keys, while a JSON array can be indexed with integer keys. If the type of the data is not right for the type with which it is being indexed, or if a map does not contain the key being indexed, or if the index into a vector is out of bounds, the returned element is Value::Null.

When a Value is printed, it is printed as a JSON string. So in the code above, the output looks like Please call "John Doe" at the number "+44 1234567". The quotation marks appear because v["name"] is a &Value containing a JSON string and its JSON representation is "John Doe". Printing as a plain string without quotation marks involves converting from a JSON string to a Rust string with as_str() or avoiding the use of Value as described in the following section.

The Value representation is sufficient for very basic tasks but can be tedious to work with for anything more significant. Error handling is verbose to implement correctly, for example imagine trying to detect the presence of unrecognized fields in the input data. The compiler is powerless to help you when you make a mistake, for example imagine typoing v["name"] as v["nmae"] in one of the dozens of places it is used in your code.

Parsing JSON as strongly typed data structures

Serde provides a powerful way of mapping JSON data into Rust data structures largely automatically.

use serde::{Deserialize, Serialize};
use serde_json::Result;

#[derive(Serialize, Deserialize)]
struct Person {
    name: String,
    age: u8,
    phones: Vec<String>,
}

fn typed_example() -> Result<()> {
    // Some JSON input data as a &str. Maybe this comes from the user.
    let data = r#"
        {
            "name": "John Doe",
            "age": 43,
            "phones": [
                "+44 1234567",
                "+44 2345678"
            ]
        }"#;

    // Parse the string of data into a Person object. This is exactly the
    // same function as the one that produced serde_json::Value above, but
    // now we are asking it for a Person as output.
    let p: Person = serde_json::from_str(data)?;

    // Do things just like with any other Rust data structure.
    println!("Please call {} at the number {}", p.name, p.phones[0]);

    Ok(())
}

This is the same serde_json::from_str function as before, but this time we assign the return value to a variable of type Person so Serde will automatically interpret the input data as a Person and produce informative error messages if the layout does not conform to what a Person is expected to look like.

Any type that implements Serde's Deserialize trait can be deserialized this way. This includes built-in Rust standard library types like Vec<T> and HashMap<K, V>, as well as any structs or enums annotated with #[derive(Deserialize)].

Once we have p of type Person, our IDE and the Rust compiler can help us use it correctly like they do for any other Rust code. The IDE can autocomplete field names to prevent typos, which was impossible in the serde_json::Value representation. And the Rust compiler can check that when we write p.phones[0], then p.phones is guaranteed to be a Vec<String> so indexing into it makes sense and produces a String.

The necessary setup for using Serde's derive macros is explained on the Using derive page of the Serde site.

Constructing JSON values

Serde JSON provides a json! macro to build serde_json::Value objects with very natural JSON syntax.

use serde_json::json;

fn main() {
    // The type of `john` is `serde_json::Value`
    let john = json!({
        "name": "John Doe",
        "age": 43,
        "phones": [
            "+44 1234567",
            "+44 2345678"
        ]
    });

    println!("first phone number: {}", john["phones"][0]);

    // Convert to a string of JSON and print it out
    println!("{}", john.to_string());
}

The Value::to_string() function converts a serde_json::Value into a String of JSON text.

One neat thing about the json! macro is that variables and expressions can be interpolated directly into the JSON value as you are building it. Serde will check at compile time that the value you are interpolating is able to be represented as JSON.

let full_name = "John Doe";
let age_last_year = 42;

// The type of `john` is `serde_json::Value`
let john = json!({
    "name": full_name,
    "age": age_last_year + 1,
    "phones": [
        format!("+44 {}", random_phone())
    ]
});

This is amazingly convenient, but we have the problem we had before with Value: the IDE and Rust compiler cannot help us if we get it wrong. Serde JSON provides a better way of serializing strongly-typed data structures into JSON text.

Creating JSON by serializing data structures

A data structure can be converted to a JSON string by serde_json::to_string. There is also serde_json::to_vec which serializes to a Vec<u8> and serde_json::to_writer which serializes to any io::Write such as a File or a TCP stream.

use serde::{Deserialize, Serialize};
use serde_json::Result;

#[derive(Serialize, Deserialize)]
struct Address {
    street: String,
    city: String,
}

fn print_an_address() -> Result<()> {
    // Some data structure.
    let address = Address {
        street: "10 Downing Street".to_owned(),
        city: "London".to_owned(),
    };

    // Serialize it to a JSON string.
    let j = serde_json::to_string(&address)?;

    // Print, write to a file, or send to an HTTP server.
    println!("{}", j);

    Ok(())
}

Any type that implements Serde's Serialize trait can be serialized this way. This includes built-in Rust standard library types like Vec<T> and HashMap<K, V>, as well as any structs or enums annotated with #[derive(Serialize)].

Performance

It is fast. You should expect in the ballpark of 500 to 1000 megabytes per second deserialization and 600 to 900 megabytes per second serialization, depending on the characteristics of your data. This is competitive with the fastest C and C++ JSON libraries or even 30% faster for many use cases. Benchmarks live in the serde-rs/json-benchmark repo.

Getting help

Serde is one of the most widely used Rust libraries, so any place that Rustaceans congregate will be able to help you out. For chat, consider trying the #rust-questions or #rust-beginners channels of the unofficial community Discord (invite: https://discord.gg/rust-lang-community), the #rust-usage or #beginners channels of the official Rust Project Discord (invite: https://discord.gg/rust-lang), or the #general stream in Zulip. For asynchronous, consider the [rust] tag on StackOverflow, the /r/rust subreddit which has a pinned weekly easy questions post, or the Rust Discourse forum. It's acceptable to file a support issue in this repo, but they tend not to get as many eyes as any of the above and may get closed without a response after some time.

No-std support

As long as there is a memory allocator, it is possible to use serde_json without the rest of the Rust standard library. This is supported on Rust 1.36+. Disable the default "std" feature and enable the "alloc" feature:

[dependencies]
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }

For JSON support in Serde without a memory allocator, please see the serde-json-core crate.

Link: https://crates.io/crates/serde_json

#rust  #rustlang  #encode   #json 

Serde JSON: JSON Support for Serde Framework
Michael Bryan

Michael Bryan

1652838341

How to Attach Multiple Network Interfaces to Buckets in Kubernetes

Multus-CNI

Multus CNI enables attaching multiple network interfaces to pods in Kubernetes.

How it works

Multus CNI is a container network interface (CNI) plugin for Kubernetes that enables attaching multiple network interfaces to pods. Typically, in Kubernetes each pod only has one network interface (apart from a loopback) -- with Multus you can create a multi-homed pod that has multiple interfaces. This is accomplished by Multus acting as a "meta-plugin", a CNI plugin that can call multiple other CNI plugins.

Multus CNI follows the Kubernetes Network Custom Resource Definition De-facto Standard to provide a standardized method by which to specify the configurations for additional network interfaces. This standard is put forward by the Kubernetes Network Plumbing Working Group.

Multus is one of the projects in the Baremetal Container Experience kit

Multi-Homed pod

Here's an illustration of the network interfaces attached to a pod, as provisioned by Multus CNI. The diagram shows the pod with three interfaces: eth0, net0 and net1. eth0 connects kubernetes cluster network to connect with kubernetes server/services (e.g. kubernetes api-server, kubelet and so on). net0 and net1 are additional network attachments and connect to other networks by using other CNI plugins (e.g. vlan/vxlan/ptp).

Quickstart Installation Guide

The quickstart installation method for Multus requires that you have first installed a Kubernetes CNI plugin to serve as your pod-to-pod network, which we refer to as your "default network" (a network interface that every pod will be creatd with). Each network attachment created by Multus will be in addition to this default network interface. For more detail on installing a default network CNI plugins, refer to our quick-start guide.

Clone this GitHub repository, we'll apply a daemonset which installs Multus using to kubectl from this repo. From the root directory of the clone, apply the daemonset YAML file:

$ cat ./images/multus-daemonset.yml | kubectl apply -f -

This will configure your systems to be ready to use Multus CNI, but, to get started with adding additional interfaces to your pods, refer to our complete quick-start guide

Additional installation Options

  • Install via daemonset using the quick-start guide, above.
  • Download binaries from release page
  • By Docker image from Docker Hub
  • Or, roll-your-own and build from source

Comprehensive Documentation

Contact Us

For any questions about Multus CNI, feel free to ask a question in #general in the NPWG Slack, or open up a GitHub issue. Request an invite to NPWG slack here.

Download Details:
 

Author: ambassify
Download Link: Download The Source Code
Official Website: https://github.com/ambassify/multus-cni 
License: Apache-2.0 license

#kubernetes #golang 

NEAR Blockchain Explorer

In development.

Setup

Docker-based Setup

Prerequisite:

  • Docker
  • Docker-Compose

Build Docker images:

$ docker-compose build

Run them:

$ docker-compose up

NOTE: You may want to run them in background, so just add --detach flag.

Now you can reach the services:

  • http://localhost:3000/ -- frontend
  • ws://localhost:10000/ws -- WAMP router (you don't need it unless you are a developer)

Development Q&A

Q: How to run the local development version of the frontend/backend?

A: It is recommended to use docker-compose to run all the services and then stop the one that you want to develop locally (docker-compose stop frontend). (Follow the execution instructions written in the relevant README file of the subproject)

Q: How to query Explorer backend from CLI?

A: Having the backend running, you can query it from CLI just like you can do from the frontend using wamp-cli:

$ npm install wamp-cli
$ ./node_modules/.bin/wampc ws://localhost:10000/ws near-explorer

> session.call('com.nearprotocol.mainnet.explorer.contract-info', ["aurora.near"]).then(console.log);

Q: How to auto-format the source code on commit?

A: Use npm install from the root of the project, so it sets up the git hooks which automatically run prettier on every commit. (We wish we don't need to have the root package.json, but husky does not support subpackages nicely)

Contributing

To contribute to NEAR Explorer, please see CONTRIBUTING.

Most real-time collaboration happens in a variety of channels on the NEAR Discord server, with channels dedicated for getting help, community, documentation, and all major contribution areas in the NEAR ecosystem. A good place to ask for help would be the #general channel.

Download Details:
Author: near
Source Code: https://github.com/near/near-explorer
License: View license

#blockchain  #smartcontract  #near #typescript 

NEAR Blockchain Explorer

Vitess: A Database Clustering System For Horizontal Scaling Of MySQL

Vitess

Vitess is a database clustering system for horizontal scaling of MySQL through generalized sharding.

By encapsulating shard-routing logic, Vitess allows application code and database queries to remain agnostic to the distribution of data onto multiple shards. With Vitess, you can even split and merge shards as your needs grow, with an atomic cutover step that takes only a few seconds.

Vitess has been a core component of YouTube's database infrastructure since 2011, and has grown to encompass tens of thousands of MySQL nodes.

For more about Vitess, please visit vitess.io.

Vitess has a growing community. You can view the list of adopters here.

Reporting a Problem, Issue, or Bug

To report a problem, the best way to get attention is to create a GitHub issue using proper severity level based on this guide.

For topics that are better discussed live, please join the Vitess Slack workspace. You may post any questions on the #general channel or join some of the special-interest channels.

Follow Vitess Blog for low-frequency updates like new features and releases.

Security

Reporting Security Vulnerabilities

To report a security vulnerability, please email vitess-maintainers.

See Security for a full outline of the security process.

Security Audit

A third party security audit was performed by Cure53. You can see the full report here.


Author: vitessio
Source Code: https://github.com/vitessio/vitess
License: Apache-2.0 license

#mysql 

Vitess: A Database Clustering System For Horizontal Scaling Of MySQL

Nym Privacy: Composed Of Multiple Rust Crates

The Nym Privacy Platform

The platform is composed of multiple Rust crates. Top-level executable binary crates include:

  • nym-mixnode - shuffles Sphinx packets together to provide privacy against network-level attackers.
  • nym-client - an executable which you can build into your own applications. Use it for interacting with Nym nodes.
  • nym-socks5-client - a Socks5 proxy you can run on your machine, and use with existing applications
  • nym-gateway - acts sort of like a mailbox for mixnet messages, removing the need for directly delivery to potentially offline or firewalled devices.
  • nym-network-monitor - sends packets through the full system to check that they are working as expected, and stores node uptime histories as the basis of a rewards system ("mixmining" or "proof-of-mixing").
  • nym-explorer - a (projected) block explorer and (existing) mixnet viewer.
  • nym-wallet - a desktop wallet implemented using the Tauri framework.

Building

Platform build instructions are available on our docs site.

Developing

There's a .env.sample-dev file provided which you can rename to .env if you want convenient logging, backtrace, or other environment variables pre-set. The .env file is ignored so you don't need to worry about checking it in.

Developer chat

You can chat to us in Keybase. Download their chat app, then click Teams -> Join a team. Type nymtech.friends into the team name and hit continue. For general chat, hang out in the #general channel. Our development takes places in the #dev channel. Node operators should be in the #node-operators channel.

Rewards

Node, node operator and delegator rewards are determined according to the principles laid out in the section 6 of Nym Whitepaper. Below is a TLDR of the variables and formulas involved in calculating the epoch rewards. Initial reward pool is set to 250 million Nym, making the circulating supply 750 million Nym.

SymbolDefinition
global share of rewards available, starts at 2% of the reward pool.
node reward for mixnode i.
ratio of total node stake (node bond + all delegations) to the token circulating supply.
ratio of stake operator has pledged to their node to the token circulating supply.
fraction of total effort undertaken by node i, set to 1/k.
number of nodes stakeholders are incentivised to create, set by the validators, a matter of governance. Currently determined by the reward set size, and set to 720 in testnet Sandbox.
Sybil attack resistance parameter - the higher this parameter is set the stronger the reduction in competitivness gets for a Sybil attacker.
declared profit margin of operator i, defaults to 10% in.
uptime of node i, scaled to 0 - 1, for the rewarding epoch
cost of operating node i for the duration of the rewarding eopoch, set to 40 NYMT.

Node reward for node i is determined as:

where:

and

Operator of node i is credited with the following amount:

Delegate with stake s recieves:

where s' is stake s scaled over total token circulating supply.

Licensing and copyright information

This program is available as open source under the terms of the Apache 2.0 license. However, some elements are being licensed under CC0-1.0 and MIT. For accurate information, please check individual files.

Download Details:
Author: nymtech
Source Code: https://github.com/nymtech/nym
License:

#rust  #blockchain 

Nym Privacy: Composed Of Multiple Rust Crates

Orange3: Interactive Data Analysis

Orange Data Mining

Orange is a data mining and visualization toolbox for novice and expert alike. To explore data with Orange, one requires no programming or in-depth mathematical knowledge. We believe that workflow-based data science tools democratize data science by hiding complex underlying mechanics and exposing intuitive concepts. Anyone who owns data, or is motivated to peek into data, should have the means to do so.

Example Workflow 

Installing

Easy installation

For easy installation, Download the latest released Orange version from our website. To install an add-on, head to Options -> Add-ons... in the menu bar.

Installing with Conda

First, install Miniconda for your OS.

Then, create a new conda environment, and install orange3:

# Add conda-forge to your channels for access to the latest release
conda config --add channels conda-forge

# Perhaps enforce strict conda-forge priority
conda config --set channel_priority strict

# Create and activate an environment for Orange
conda create python=3 --yes --name orange3
conda activate orange3

# Install Orange
conda install orange3

For installation of an add-on, use:

conda install orange3-<addon name>

See specific add-on repositories for details.

Installing with pip

We recommend using our standalone installer or conda, but Orange is also installable with pip. You will need a C/C++ compiler (on Windows we suggest using Microsoft Visual Studio Build Tools).

Installing with winget (Windows only)

To install Orange with winget, run:

winget install --id  UniversityofLjubljana.Orange 

Running

Ensure you've activated the correct virtual environment. If following the above conda instructions:

conda activate orange3

Run orange-canvas or python3 -m Orange.canvas. Add --help for a list of program options.

Starting up for the first time may take a while.

Developing

Want to write a widget? Use the Orange3 example add-on template.

Want to get involved? Join us on Discord, introduce yourself in #general!

Take a look at our contributing guide and style guidelines.

Check out our widget development docs for a comprehensive guide on writing Orange widgets.

The Orange ecosystem

The development of core Orange is primarily split into three repositories:

biolab/orange-canvas-core implements the canvas,
biolab/orange-widget-base is a handy widget GUI library,
biolab/orange3 brings it all together and implements the base data mining toolbox.

Additionally, add-ons implement additional widgets for more specific use cases. Anyone can write an add-on. Some of our first-party add-ons:

Setting up for core Orange development

First, fork the repository by pressing the fork button in the top-right corner of this page.

Set your GitHub username,

export MY_GITHUB_USERNAME=replaceme

create a conda environment, clone your fork, and install it:

conda create python=3 --yes --name orange3
conda activate orange3

git clone ssh://git@github.com/$MY_GITHUB_USERNAME/orange3

pip install -e orange3

Now you're ready to work with git. See GitHub's guides on pull requests, forks if you're unfamiliar. If you're having trouble, get in touch on Discord.

Running

Run Orange with python -m Orange.canvas (after activating the conda environment).

python -m Orange.canvas -l 2 --no-splash --no-welcome will skip the splash screen and welcome window, and output more debug info. Use -l 4 for more.

Add --clear-widget-settings to clear the widget settings before start.

To explore the dark side of the Orange, try --style=fusion:breeze-dark

Argument --help lists all available options.

To run tests, use unittest Orange.tests Orange.widgets.tests

Setting up for development of all components

Should you wish to contribute Orange's base components (the widget base and the canvas), you must also clone these two repositories from Github instead of installing them as dependencies of Orange3.

First, fork all the repositories to which you want to contribute.

Set your GitHub username,

export MY_GITHUB_USERNAME=replaceme

create a conda environment, clone your forks, and install them:

conda create python=3 --yes --name orange3
conda activate orange3

git clone ssh://git@github.com/$MY_GITHUB_USERNAME/orange-widget-base
pip install -e orange-widget-base

git clone ssh://git@github.com/$MY_GITHUB_USERNAME/orange-canvas-core
pip install -e orange-canvas-core

git clone ssh://git@github.com/$MY_GITHUB_USERNAME/orange3
pip install -e orange3

# Repeat for any add-on repositories

It's crucial to install orange-base-widget and orange-canvas-core before orange3 to ensure that orange3 will use your local versions.

Author: biolab
Source Code: https://github.com/biolab/orange3
License: View license

#python #orange 

Orange3: Interactive Data Analysis
Mike  Kozey

Mike Kozey

1648160880

Timy Messenger: Group Messaging App with A Focus on Organizing Events

Timy app

An amazing open-source group messaging app build with flutter. ✨

Main Features

  • Multiple groups (similar to Teams in Slack).
  • Multiple open or private channels within groups.
  • Sharing of photos and photo collections.
  • React to messages with emoji.
  • Push-notifications for the message and channel updates.
  • Specific channels for events (e.g. containing date, venue).
  • Editing of event channels.
  • Calendar for all upcoming and past events aggregated over all groups and channels.
  • English and German localization.
  • RSVP for events.

screenshots

Project Structure

This is a Flutter mobile app targeting Android and iOS.

The code for the Flutter app is contained in the folder lib and the different native apps are in android and ios. Extra project assets are in assets and fonts.

As well, this repo hosts a series of Firebase config files and cloud functions.

The documentation for Firebase part is inside the firebase folder.

Prerequisites & Getting Started

Client

To build and run the mobile apps you’ll need to install Flutter and its dependencies. To verify your installation run in the project’s root directory:

$ flutter doctor

The app is optimised for Android and iOS phones in portrait mode.

IMPORTANT: The project only supports Flutter version 1.10.5, you will have to change your configuration to it. We cannot make sure that other Flutter versions will work.

$ flutter version 1.10.5

Note: Additionally you’ll need to setup the backend and add the GoogleService-Info of your Firebase app to your clients as described below.

Backend (Firebase)

The backend is build using Firebase’s node.js SDK. All files are provided in the firebase folder. To deploy the code create an app and install the firebase CLI (See steps 1 & 2 in Getting started).

Note: The following steps assume you’re using Firebases’ free Spark Plan. Therefore we’re performing the configuration manually.

B1. Setup sign-in method & adding users

An initial sign-in method needs to be configured.

Adding a user

Currently, users need to be added manually.

  • In firebase navigate to Authentication and select Users.
  • Then Add user.

Please copy the User-UID of the created user. We’ll need to add this ID to a group in the next step.

Note: You’ll need to have at least one user configured to use the app.

B2. Configure firebase app

Next, you’ll need to configure your firebase app for Flutter as described in Add Firebase to an App / Flutter

iOS

  • Enter iOS-Bundle-ID: de.janoodle.circlesApp.debug
  • Download and rename GoogleService-Info.plist to GoogleService-Info-Dev.plist.
  • Copy file to ios/Runner/Firebase.

NOTE: If you’re building for release you’ll additionally need to add a GoogleService-Info-Prod.plist pointing to your production Firebase app.

Android

Follow the instructions in android/README.md.

B3. Create and setup database

In the firebase console select Database under Develop and create a Cloud Firestore Database. Setup database in test mode if you don't want to care about access permissions now.

At this point, you need to run and perform login once on the App, it will create a user document inside the users collection.

You will see an empty screen. To fix that, continue this setup. You may need to restart the app after the setup is done.

Create group collection

  • Select the database you’ve just created.
  • Create collection and name it groups.
  • Add your first group with the following properties:
nametypevalue
abbreviationstringTE
colorstringffffff
membersarrayUser-UID we’ve retrieved in Adding a user above
namestringtest

We’ve now setup our first test group. In addition to this step, we’ll need to setup a default Channel (e.g. something similar to #general in Slack).

Add the new created Group id to the User document

  • Select the User you have now on your database.
  • Add a new field named joinedGroups and make it type Array
  • Add an entry in this array, with the value equal to the Group document id from Firestore.

Create channel sub-collection

  • In the groups collection select the newly created group.
  • Create collection within the group called channels.
  • Add your first channel with the following properties:
nametypevalue
namestringgeneral
typestringTOPIC
visibilitystringOPEN

Your Firestore database should look like this (with different ids)

screenshots screenshots screenshots screenshots

B4. Deploy firebase functions

Navigate to the firebase directory and deploy all functions using:

$ firebase deploy --only functions

Some features of the app can be used without Cloud Functions running, but some others will not work. We recommend you to perform this step to enjoy all features.

B5. Final steps

Login with the user you’ve created above.

Next create your first event to setup the calendar collection in our backend.

Create an event

  • In the app select the hamburger menu
  • Hit the + sign next to Events
  • Enter any data you like and hit Create

At the root level of your database you should now see a collection called calendar in your firebase console.

Now we’re ready to deploy all other parts of our backend using:

$ firebase deploy

Deployment

The app is setup to work with a development and production environment. We suggest you create a different Firebase app for each environment.

When building for release the app will automatically use the production configuration that you’ve configured in step B3.

External resources

About

The concept for Timy was created and developed by kaalita and philippmoeser. The initial version is a MVP messaging app focusing on organising events among groups.

We hope this project can be a reference or building block for your next flutter app. 🚀

Author: janoodleFTW
Source Code: https://github.com/janoodleFTW/timy-messenger 
License: Apache-2.0 License

#flutter #dart 

Timy Messenger: Group Messaging App with A Focus on Organizing Events

Vitess: Database Clustering System for Horizontal Scaling Of MySQL

Vitess

Vitess is a database clustering system for horizontal scaling of MySQL through generalized sharding.

By encapsulating shard-routing logic, Vitess allows application code and database queries to remain agnostic to the distribution of data onto multiple shards. With Vitess, you can even split and merge shards as your needs grow, with an atomic cutover step that takes only a few seconds.

Vitess has been a core component of YouTube's database infrastructure since 2011, and has grown to encompass tens of thousands of MySQL nodes.

For more about Vitess, please visit vitess.io.

Vitess has a growing community. You can view the list of adopters here.

Reporting a Problem, Issue, or Bug

To report a problem, the best way to get attention is to create a GitHub issue using proper severity level based on this guide.

For topics that are better discussed live, please join the Vitess Slack workspace. You may post any questions on the #general channel or join some of the special-interest channels.

Follow Vitess Blog for low-frequency updates like new features and releases.

Security

Reporting Security Vulnerabilities

To report a security vulnerability, please email vitess-maintainers.

See Security for a full outline of the security process.

Security Audit

A third party security audit was performed by Cure53. You can see the full report here.

Author: Vitessio
Source Code: https://github.com/vitessio/vitess 
License: Apache-2.0 License

#go #golang #mysql #kubernetes 

Vitess: Database Clustering System for Horizontal Scaling Of MySQL

The Nym Privacy Platform Written in Rust

The Nym Privacy Platform

The platform is composed of multiple Rust crates. Top-level executable binary crates include:

  • nym-mixnode - shuffles Sphinx packets together to provide privacy against network-level attackers.
  • nym-client - an executable which you can build into your own applications. Use it for interacting with Nym nodes.
  • nym-socks5-client - a Socks5 proxy you can run on your machine, and use with existing applications
  • nym-gateway - acts sort of like a mailbox for mixnet messages, removing the need for directly delivery to potentially offline or firewalled devices.
  • nym-network-monitor - sends packets through the full system to check that they are working as expected, and stores node uptime histories as the basis of a rewards system ("mixmining" or "proof-of-mixing").
  • nym-explorer - a (projected) block explorer and (existing) mixnet viewer.
  • nym-wallet - a desktop wallet implemented using the Tauri framework.

Building

Platform build instructions are available on our docs site.

Developing

There's a .env.sample-dev file provided which you can rename to .env if you want convenient logging, backtrace, or other environment variables pre-set. The .env file is ignored so you don't need to worry about checking it in.

Developer chat

You can chat to us in Keybase. Download their chat app, then click Teams -> Join a team. Type nymtech.friends into the team name and hit continue. For general chat, hang out in the #general channel. Our development takes places in the #dev channel. Node operators should be in the #node-operators channel.

Rewards

Node, node operator and delegator rewards are determined according to the principles laid out in the section 6 of Nym Whitepaper. Below is a TLDR of the variables and formulas involved in calculating the epoch rewards. Initial reward pool is set to 250 million Nym, making the circulating supply 750 million Nym.

SymbolDefinition
global share of rewards available, starts at 2% of the reward pool.
node reward for mixnode i.
ratio of total node stake (node bond + all delegations) to the token circulating supply.
ratio of stake operator has pledged to their node to the token circulating supply.
fraction of total effort undertaken by node i, set to 1/k.
number of nodes stakeholders are incentivised to create, set by the validators, a matter of governance. Currently determined by the reward set size, and set to 720 in testnet Sandbox.
Sybil attack resistance parameter - the higher this parameter is set the stronger the reduction in competitivness gets for a Sybil attacker.
declared profit margin of operator i, defaults to 10% in.
uptime of node i, scaled to 0 - 1, for the rewarding epoch
cost of operating node i for the duration of the rewarding eopoch, set to 40 NYMT.

Node reward for node i is determined as:

where:

and

Operator of node i is credited with the following amount:

Delegate with stake s recieves:

where s' is stake s scaled over total token circulating supply.

Licensing and copyright information

This program is available as open source under the terms of the Apache 2.0 license. However, some elements are being licensed under CC0-1.0 and MIT. For accurate information, please check individual files.

Download Details:
Author: nymtech
Source Code: https://github.com/nymtech/nym
License:

#rust  #blockchain  #cosmos 

The Nym Privacy Platform Written in Rust
Bertrand  Upton

Bertrand Upton

1647169200

Slacker: Full-featured Python interface for The Slack API

This repository is archived and will not receive any updates

It's time to say goodbye. I'm archiving Slacker. It's been getting harder to find time to maintain this project for a while now. For years it's been the most popular Python library for Slack. Eventually Slack decided to go with their library, and I lost my motivation to maintain it. Thank you all for your contributions to this project.

Slacker

About

Slacker is a full-featured Python interface for the Slack API.

Installation

$ pip install slacker

Examples

from slacker import Slacker

slack = Slacker('<your-slack-api-token-goes-here>')

# Send a message to #general channel
slack.chat.post_message('#general', 'Hello fellow slackers!')

# Get users list
response = slack.users.list()
users = response.body['members']

# Upload a file
slack.files.upload('hello.txt')

# If you need to proxy the requests
proxy_endpoint = 'http://myproxy:3128'
slack = Slacker('<your-slack-api-token-goes-here>',
                http_proxy=proxy_endpoint,
                https_proxy=proxy_endpoint)

# Advanced: Use `request.Session` for connection pooling (reuse)
from requests.sessions import Session
with Session() as session:
    slack = Slacker(token, session=session)
    slack.chat.post_message('#general', 'All these requests')
    slack.chat.post_message('#general', 'go through')
    slack.chat.post_message('#general', 'a single https connection')

Author: os
Source Code: https://github.com/os/slacker
License: Apache-2.0 License

#python 

Slacker: Full-featured Python interface for The Slack API
Lawrence  Lesch

Lawrence Lesch

1644684259

Docusaurus: Easy to Maintain Open Source Documentation Websites

Docusaurus

We are working hard on Docusaurus v2. If you are new to Docusaurus, try using the new version instead of v1. See the Docusaurus v2 website for more details.

Docusaurus v1 doc is available at v1.docusaurus.io and code is available on branch docusaurus-v1

Introduction

Docusaurus is a project for building, deploying, and maintaining open source project websites easily.

Short on time? Check out our 5-minute tutorial ⏱️!

Tip: use docusaurus.new to test Docusaurus immediately in a playground.

  • Simple to Start

Docusaurus is built in a way so that it can get running in as little time as possible. We've built Docusaurus to handle the website build process so you can focus on your project.

  • Localizable

Docusaurus ships with localization support via CrowdIn. Empower and grow your international community by translating your documentation.

  • Customizable

While Docusaurus ships with the key pages and sections you need to get started, including a home page, a docs section, a blog, and additional support pages, it is also customizable as well to ensure you have a site that is uniquely yours.

Installation

Use the initialization cli to create your site:

npm init docusaurus@latest [name] [template]

Example:

npm init docusaurus@latest my-website classic

Contributing

We've released Docusaurus because it helps us better scale and supports the many OSS projects at Facebook. We hope that other organizations can benefit from the project. We are thankful for any contributions from the community.

Code of Conduct

Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

Contributing guide

Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Docusaurus.

Beginner-friendly bugs

To help you get your feet wet and get you familiar with our contribution process, we have a list of beginner-friendly bugs that might contain smaller issues to tackle first. This is a great place to get started.

Contact

We have a few channels for contact:

Author: Facebook
Source Code: https://github.com/facebook/docusaurus 
License: View license

#javascript #react  

Docusaurus: Easy to Maintain Open Source Documentation Websites