From c0fa8c8002bbc7f6b8689dd3aaee0959e0154ca1 Mon Sep 17 00:00:00 2001 From: Guillem Borrell Date: Tue, 9 Jan 2024 12:47:08 +0100 Subject: [PATCH] Minimal changes --- Caddyfile | 8 +++++++ README.md | 6 +++--- docs/organization.md | 42 ++++++++++++++++++++++++++++++++++-- pyproject.toml | 4 +++- src/retailtwin/api/README.md | 2 +- 5 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 Caddyfile diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..51c6e73 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,8 @@ +:80 { + handle_path /api/v1/* { + reverse_proxy localhost:8000 + } + file_server { + root src/retailtwin/api/static + } +} \ No newline at end of file diff --git a/README.md b/README.md index f505f69..7cb2684 100644 --- a/README.md +++ b/README.md @@ -15,19 +15,19 @@ createdb -h localhost -U postgresuser retail In this case we decided to call the database `retail` and we created it in the same computer we will be running the digital twin. Then sync the data models in the freshly created database with: ```bash -retailtwin.exe init postgresql://postgresuser:password@localhost/retail +retailtwin init postgresql://postgresuser:password@localhost/retail ``` Then we can populate the database with dummy data with the `bootstrap` subcommand: ```bash -retailtwin.exe bootstrap postgresql://postgresuser:password@localhost/retail +retailtwin bootstrap postgresql://postgresuser:password@localhost/retail ``` Finally we can create all the necessary functions, procedures, and triggers with ```bash -retailtwin.exe sync postgresql://postgresuser:password@localhost/retail +retailtwin sync postgresql://postgresuser:password@localhost/retail ``` ## Terminals diff --git a/docs/organization.md b/docs/organization.md index b7b94ee..6b0382f 100644 --- a/docs/organization.md +++ b/docs/organization.md @@ -47,11 +47,19 @@ Risk management involves It's very common to forget about IT costs when estimating the value of a case. -IT may come with a multi-million euro request to run your project. This is why many corporations are reluctant to build capabilities that run on razor-thin margins. Plans that gent implemented need an early estimation of +It's very common to ignore about information security, and constraints with personal information, when pushing for value. + +IT may come with a multi-million euro request to run your project. This is why many corporations are reluctant to build capabilities that run on razor-thin margins. Plans that gent implemented need an early estimation of. + +The most pressing risk is the one of oversimplification. Business leaders tend to focus on what's possible, and underestimate the difficulties hidden on the implementation details. I call this the Elon Musk Syndrome. + +!!! note + + Elon Musk has systematically made claims to customers and investors that could not meet afterwards. From systematically failing to predict the number of Tesla cars built each year, to the development of [Optimus](https://en.wikipedia.org/wiki/Optimus_(robot)). Fortunately for Musk, he's not running a traditional corporation, that would get systematically take hit on their sales for these unmet claims, but a religion. ## Teaming with IT -Fully functional BCG case teams will staff engineers from X or PLA that will deal with all the IT-related details, but sometimes teams are understaffed, or the budget is insuffcient to allocate the necessary profiles. Sometimes a core senior associate has to lead the relationship with IT. +Fully functional BCG case teams will staff engineers from X and architects from PLA that will deal with all the IT-related details, but sometimes teams are understaffed, or the budget is insuffcient to allocate the necessary profiles. Sometimes a core senior associate has to lead the relationship with IT. * Involve them as soon as possible * Let them contribute @@ -65,6 +73,22 @@ The most usual reason why IT may not be willing to help is because they don't ha 3. Echo their staffing needs. In the end the goal of every department is to grow in size and importance. 4. Praise their work +## Antipatterns + +One consequence of the tension between value and ownership is the existence of [Palantir](https://www.palantir.com/). The value proposion of Palantir is that's impossible to capture value from data analytics and applications when the infrastructure is run by IT departments. According to their pitch, it just takes too long to get anything done, and they can't be trusted to build a valid development ecosystem suitable for advanced analytics. The only way around that issue is to create a set of data integrations to push data to the cloud, and pay a monthly subscription for their hosted analytics solution. + +This just trades a short-term issue into a long term risk: vendor lock. + +It also neglects how interwouned IT is with the rest of the organization. Assume that the CFO needs to execute aggressive cost cuts, takes a look at the different providers, and sees €1.5M/year for Palantir in the Marketing division's budget. But Palantir is a platform for data! How come the director of IT never signed off that spending, or at least was asked to provide an alternative? And while other departments are laying off personnel, and shutting down non-critical applications, a significant portion of the Marketing funds are spent in the most aggressive vendor-locked asset that there is. + +Thinking about the entire value chain, and the complete timeline, including short and long term consequences, is something that the management consultants (that mostly deal with strategy) should know what to do. + +## With cloud, IT may be split. + +In some organizations the IT assets may be split. Historically, IT assets used to be hosted as part of the organization's own infrastructure, and some of the budget was spent purchasing servers and storage cabinets. + +Cloud has raised the level to access. + ## Dysfunctional IT departments There are many reasons why an IT department becames dysfunctional, but the main one comes from the tendency of turning IT into a kitchen sink of ownership. Healthy organizations try to align responsabilities with incentives, but it's relatively uncommon. Assume a b2b business that is growing fast, and the Marketing division needs a new CRM to be able to handle all the new customers. In a healthy organization IT will be involved in the planning stage as part of a joint team with all the stakeholders. Involving IT may have unintended consequences, like discarding the Marketing team's preferred software because the technological stack is imcompatible with the current and future IT strategy. In an unhealthy organization, the CMO will tell the CTO that software X must available, and the request will be waterfalled to the IT department that will need to figre out how much it costs, and find a way to integrate it, operate it, evolve it... @@ -77,3 +101,17 @@ If this situaition extends for a long time, the IT department isolates as a mech If none of theat works, call the experts. There are many seasoned engineers at BCG who can help you execute in the harshest environments, even with hostile IT departments. Sometimes the final decision is to go nuclear and let BCG host the solution while requesting the minimal help from IT. This makes the project significantly more expensive, but it's often the only way to reach the goals that were agreed with the client. +## People + +Each organization implements their IT capabilities in a slightly different way + +* CTO. (Chief Transformation Officer, Chief Transformation and Product Officer...) Value based, process centered, not really into the technical details. May be in charge of IT (some companies don't have a CIO). +* CIO. Oversees everything related with IT, including systems, procurement, strategy... May report to CTO. +* CISO. Also takes care of information security (devices, network, policies, access)... May report to CIO or CTO. +* Director of Systems. Owns the IT's budget. +* Director of Architecture / IT. Owns new assets. +* Director of Innovation. Owns new applications. May own part of budget. +* Director of Data / Engineering. Owns data health and availablity. +* Director of Data Science / Analytics. Owns data insights. +* Director of *division*. +* Cloud architects \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 936bb9b..d5ba508 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,9 @@ dependencies = [ "prompt_toolkit", "asyncpg", "psycopg2-binary", - "pydantic-settings" + "pydantic-settings", + "fastapi", + "uvicorn" ] diff --git a/src/retailtwin/api/README.md b/src/retailtwin/api/README.md index 46b4e1b..9506d05 100644 --- a/src/retailtwin/api/README.md +++ b/src/retailtwin/api/README.md @@ -3,7 +3,7 @@ Run the backend with ```bash -uvicorn retailtwin.api.main:app +DB_URI=postgresql+asyncpg://user:password@server/dbname uvicorn retailtwin.api.main:app ``` Use Caddy to reverse proxy and the following Caddyfile. Paths are static so you have to run caddy from the root of the package