-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Réaliser l'écriture et la lecture d'un fichier sur un système amazon cloud S3, voici la démarche suivi :
-
Créer un nouveau projet
-
Lancer un conteneur docker avec minio avec la configuration suivante
s3: image: quay.io/minio/minio ports: - ${MINIO_PORT_0:-9000}:9000 - ${MINIO_PORT_1:-9001}:9001 command: [ 'server', '/data', '--console-address', ':9001' ] volumes: - 'minio_data:/data' volumes: minio_data: -
Accéder à l'interface Minio et aller dans l'onglet bucket pour créer un nouveau bucket

-
Créer des clés d'accès pour minio, ces informations servirons pour la configuration du client S3 (key et secret).

-
composer require php-etl/satellite
-
composer require php-etl/csv-plugin
-
Configuration satellite.yaml :
satellites: csv_to_csv: label: 'CSV to CSV' filesystem: path: build pipeline: steps: - csv: extractor: file_path: '../data/input/test.csv' - csv: loader: file_path: 's3://s3filesystemtest/output/test.csv' -
php bin/satellite build src/satellite.yaml
-
Ajouter le code suivant dans le fichier pipeline.php généré par le build
$client = new S3Client([ 'version' => 'latest', 'region' => 'us-west-2', 'endpoint' => 'http://127.0.0.1:19000', 'credentials' => [ 'key' => 'ZDJ2tvFLyUIPX61P', 'secret' => 'sub9RRBtSZH3yImPckBKqCUmSbdyuwua', ], ]); $client->registerStreamWrapper(); -
php bin/satellite run:pipeline build/
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
To do


