Package: nubium-dude
View documentation @https://mkt-ops-de.pages.corp.redhat.com/dudeor
build it locally viatox -e docsInstallation and Setuppipx install --python python3.8 nubium-dudeOther python versions will also work for installing dude, but python3.8 must be present for launching apps with dude because of the virtualenvs that dude manages. There is no option to change this virtualenv version yet.ConfigurationAs most CLI tools do, dude loads configuration in a hiearchial order:defaultsconfig fileenvironment variablescommand line optionsenvironment variables that are sourced fromdotenv_fileskey in the configurationenvironment variables that are sourced from./venv/local.envtests/test_config.pyhas examples of configuration files, here's one of them:environments:
  default:
    clusters:
      default-A:
        bootstrap_urls: ["localhost", "kafka-1"]
  override:
    clusters:
      override-A:
        bootstrap_urls: ["localhost", "kafka-1"]
default_environment: defaultThe config file can be edited withdude config edit. This will launch a text
editor configured by either of theVISUALorEDITORenvironment variables.
The default path can be configured by settingDUDE_CONFIG_FILEwith the full
path to an alternative yaml file.
IfDUDE_CONFIG_FILEis not specified, an example default location
(on Mac OS) is "/Users/[username]/Library/Application Support/dude/config.yaml".Special tagsAny value can be dynamically computed frome these tags!Environmentkey's value would beos.environ["VAR_NAME"]key: !Environment VAR_NAME!DotEnvkey's value would bedotenv_values("PATH")["VAR"]key: !DotEnv [PATH, VAR]For more information on the dotenv syntax for the file pointed to by PATH, refer to see (dotenv's documentation)[https://github.com/theskumar/python-dotenv#file-format]Remnants of the previous configurationHOSTNAME=""
RHOSAK_USERNAME=(nubium-secrets.rhosakUsername)
RHOSAK_PASSWORD=(nubium-secrets.rhosakPassword)
SCHEMA_REGISTRY_USERNAME=(nubium-secrets.rhosakUsername)
SCHEMA_REGISTRY_PASSWORD=(nubium-secrets.rhosakPassword)
SCHEMA_REGISTRY_URL=(nubium-secrets.schemaRegistryUrl)Example Openshift Secret:https://manage.preprod.iad2.dc.paas.redhat.com/console/project/mktg-ops--nubium-dev/browse/secrets/nubium-secretsUsagedude --helpordude subcommand --helpManaging TopicsList topicsdude topics listTopics will be listed by cluster.Create topicsdude topics create --topics topic_a,topic_bIf a topic is defined in the selected environment's configuration, then it will be created with the same configuration
defined in that file. Otherwise, the topic is created with a default configuration (note:dude topics create --helpwill show the defaults).Create topics with custom partitions and replication factordude topics create --topics topic_a --num-partitions 2 --replication-factor 2Create topics on yourTEST_CLUSTER, ignoring cluster maps incluster.pydude topics create --topics topic_a,topic_b --ignore-cluster-mapsDelete topicsdude topics delete --topics topic_a,topic_bAppBuild requirements.txt(in app root folder):dude app build_reqsRun app(in app root folder):dude app runRun unit tests(in app root folder):dude app unit_testRun integration test(in app root folder):dude app integration_testContributingRun tests via:pipx install tox
pipx inject tox tox-pyenv
toxPass extra arguments to pytest:# run tests that have "translates" in their name
tox -e py38 -- -k translatesPipx isolated environmentsIf you want to run thedudescript based on changes in your local repo, use
the editable option when installing with pipx:pipx install -e /PATH/TO/DUDE/REPOYou can also inject editable versions of dependencies like this:pipx inject nubium-dude -e /PATH/TO/nubium-utils(Useful command for confirming whether you are using local repos for requirements:pipx runpip nubium-dude freeze)