initialize_platform
- class smarter.apps.account.management.commands.initialize_platform.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]
Bases:
SmarterCommandDjango manage.py initialize_platform command.
- call_command_or_log(failure, name, **options)[source]
Run one step of the initialization that may fail without stopping the others: log its failure.
- handle(*args, **options)[source]
Initialize the Smarter platform.
Creates the minimal resources necessary to start using Smarter. This is the one place where the platform’s example resources are created and deployed: the Helm init job and
make docker-initrun it, and nothing else.Create the admin user and the example users. The username and password come from
--usernameand--password, or fromsmarter_settings.platform_admin_usernameandadmin_password, so that the init job passes no password on its command line.Initialize the Waffle switches, the Smarter project’s index, the built-in Providers, the official extensions and the vector store providers.
Load the example manifests from GitHub, https://github.com/smarter-sh/example-manifests, and deploy their LLMClients. Then delete the example resources whose manifests were removed from it since an earlier initialization, with
delete_retired_examples.Load the Stackademy project from GitHub, deploy its LLMClients, and verify them.
Verify the DNS configuration, and sync the ledger of infrastructure resources with the Kubernetes cluster.
Deploying an LLMClient creates its DNS record and Kubernetes ingress, so the LLMClients are deployed everywhere except in the local environment, where they are only applied.
- rename_stackademy_resources(username)[source]
Move every account’s Stackademy plugins to Stackademy’s renamed Secrets and Connections.
After load_from_github, which applies the renamed resources:
manage.py rename_stackademy_resourcesmoves the plugins from the old resources to them, and deletes the old ones that nothing uses. A failure is logged, not raised: the old resources keep working until the next deployment tries again.
- upload_static_files()[source]
Upload the static files to the CDN’s bucket with collectstatic, and log what it did.
collectstatic runs silently: at verbosity 1 it prints a line for every unchanged file. It can take minutes, so the log says when it starts, and then how many files it checked, how many of them it uploaded, and how long that took.