How can I configure external logs to GCS bucket in...
# ask-ai
a
How can I configure external logs to GCS bucket in Airbyte open source
k
To configure external logs to a GCS bucket in Airbyte, you need to follow these steps: 1. Create a Google Cloud Storage Bucket: Access the Google Cloud Console and select or create a project where you want to create the bucket. Navigate to "Storage" > "Browser" in the left-side menu. Click on "Create bucket", give your bucket a unique name, select a region for the bucket, and configure other settings such as storage class and access control according to your requirements. Finally, click "Create". The bucket will be referenced as
<bucket_name>
. 2. Create a Google Cloud Service Account: In the Cloud Console, navigate to "IAM & Admin" > "Service Accounts". Click "Create Service Account", enter a name, description, and then click "Create". Assign the role of "Storage Object Admin" to the service account by selecting it from the role list. After creating the service account, click on it, go to the "Keys" tab, and then click "Add Key" > "Create new key". Choose JSON as the key type and click "Create". The key file will be downloaded automatically to your computer. Encode GCP credentials file contents using Base64. This key will be referenced as
<encoded_key>
. 3. Update the Environment Variables: Update the following Environment Variables in the global section and the worker section of your
values.yaml
file with the GCS Logging Information.
Copy code
yaml global:    state:      storage:        type: "GCS"       logs:      storage:        type: "GCS"      gcs:        bucket: "<bucket_name>"        credentials: "/secrets/gcs-log-creds/gcp.json"        credentialsJson: "<encoded_key>"    worker:     extraEnv:      - name: STATE_STORAGE_GCS_BUCKET_NAME        value: <bucket_name>      - name: STATE_STORAGE_GCS_APPLICATION_CREDENTIALS        value: /secrets/gcs-log-creds/gcp.json      - name: CONTAINER_ORCHESTRATOR_SECRET_NAME        value: <%RELEASE_NAME%>-gcs-log-creds      - name: CONTAINER_ORCHESTRATOR_SECRET_MOUNT_PATH        value: /secrets/gcs-log-creds
4. Run the Helm Command: Run the following command to install or upgrade Airbyte with the updated
values.yaml
file.
Copy code
bash helm upgrade --install %RELEASE_NAME% airbyte/airbyte -n <NAMESPACE> --values /path/to/values.yaml --version 0.54.69
Please refer to the following sources for more detailed instructions: - [Create Google Cloud Storage Bucket and Service Account](https://docs.airbyte.com/deploying-airbyte/on-kubernetes-via-helm#external-logs-with-gcs) - [Update the Environment Variables](https://docs.airbyte.com/deploying-airbyte/on-kubernetes-via-helm#update-the-valuesyaml-with-the-gcs-logging-information-below)
a
@kapa.ai I ma running Airbyte on GCP compute engine not on kubernetes , dont see any values.yml file
k
The
values.yaml
file is typically used when deploying Airbyte on Kubernetes using Helm. Since you're running Airbyte on a Google Cloud Platform (GCP) Compute Engine instance, you won't see a
values.yaml
file. Instead, you'll be using a
docker-compose.yaml
file and an
.env
file for your configuration. If you want to run Airbyte with its configs in an external Cloud SQL Postgres instance, you'll need to add a Google Cloud SQL Proxy container to the docker-compose environment to make your config database accessible to Airbyte. Here's an example of how you can replace the
db
service in `docker-compose.yaml`:
Copy code
yaml cloudsql:   image: <http://gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.6.0|gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.6.0>   container_name: airbyte-cloudsql-proxy   command: --address 0.0.0.0 --credentials-file /secrets/airbyte-sa.json your-gcp-project:us-central1:airbyte?port=5432   volumes:     - ./airbyte-sa.json:/secrets/airbyte-sa.json   networks:     - airbyte_internal   ports:     - 5432:5432   restart: always
And update the
.env
to reflect the following:
Copy code
env DATABASE_USER=airbyte DATABASE_PASSWORD=your-password-here DATABASE_HOST=cloudsql DATABASE_PORT=5432 DATABASE_DB=airbyte DATABASE_URL=jdbc:<postgresql://cloudsql:5432/airbyte>
This setup assumes that a service account JSON key (for a service account with the
cloudsql.client
role) is stored in a file named
airbyte-sa.json
in the root Airbyte folder (with
docker-compose.yaml
,
run-ab-platform.sh
, etc.) For more details, you can refer to this [discussion](https://github.com/airbytehq/airbyte/discussions/29379) on the Airbyte GitHub page.
a
@kapa.ai your reponse is about external db , I am looking to externalise logs to GCS bucket
k
A message from kapa.ai
New message text here
b
@Adnan are you using docker-compose? If so, I would recommend moving to
abctl
the documentation can be found here: https://docs.airbyte.com/using-airbyte/getting-started/oss-quickstart Once you are using
abctl
you can use the instructions here to configure GCS for external storage: https://docs.airbyte.com/deploying-airbyte/integrations/storage