Refactor Operator Tooling to be Self-Contained and Written Idiomatically

Aperta
#265 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
docker, go, kubernetes

Direzione di ricerca

Non vengono indicati file, test o punti di ingresso specifici. Inizia dalla parte Docker degli strumenti dell'operatore e inventaria le chiamate a comandi esterni e il flusso della configurazione su disco. Il lavoro è completato quando le dipendenze indicate sono gestite nel codice e gli strumenti sono autonomi, senza modificare prematuramente il comportamento di master.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The first thing I'll note is, this is going into a feature branch, not directly into master, as getting it right is more important to me than getting it in. I am opening the PR's here so the work is visible and can be commented on, but it will not change the way the Operator works today, as I wont be merging anything to master until all of the work is done.

The second thing is, I am focusing on one part at a time (Docker to start). This means I am okay breaking things related to kuberenetes up front. Once I am done with the Docker portion, I will come back through each PR and refactor each PR to work with Kubernetes. So the NodePortIP missing would be corrected in a refactor of this PR at a later time

Today the operator calls out to several command line tools: Docker, Configtxgen, Configtxlator, YTT, Crtyptogen, and even performing some tasks like moving a file by calling the bash mv as opposed to using the Go os.Rename, and until recently we also called out to the kubectl command.

This is highly problematic in that it requires the user to first put tools on their path before ever using our tool. It also prevents us from ensuring version compatibility, i.e., I don't know if they have configtxgen 2.0 or 1.1.

Because of YTT we also write a custom config to disk, over and over again. And we read the config and append data to it and write it to disk, then read it again, and append data to it and write it to disk, all before ever generating the YAML files we want.

Instead these changes will bring about proper config injection and dependency management. Creating in memory config objects where necessary and replacing tools like configtxgen and configtxlator with the fabric-config to manage config operations in code, and replace the calls to Docker with the Docker SDK, and ultimately remove YTT by replacing cryptogen with calls to the fabric CA using the Go SDK (since we aren't actually testing the functionality of cryptogen the place we get crypto from is irrelevant).

Ultimately this will allow us to remove external dependencies, and make the Operator tool a truly standalone tool.

The change to the Go SDK will allow us to embed everything we need to perform System Tests in the Operator tooling. Getting the Operator into state where it is able to extended and maintained is important, and today it is very hard to wrap your head around what is happening as a lot of things are managed on disk, rather than in code.

Lingua principale
Go
Stelle
151
Fork
128
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hyperledger/fabric-test

Tutte le issue di hyperledger/fabric-test

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.