Categories
Development Google Google Cloud Storage

Google Cloud Storage – Setting Metadata

I have issue with Google Cloud Bucket. When I call my files at Google Cloud they come with the headers private and max-age=0 so there will no caching options. I use console for setting meta-data option. I type: gsutil -m setmeta -r “Cache-Control:public, max-age=3600” gs://bucket/folder* but it does not work. What should I do? This […]

Categories
Development Docker Google Google Cloud Storage

Push a Docker image to Google Container Registry from a container running in the GKE

I have a GCP project. In there I use the GKE with a Teamcity container running. This Teamcity container is my build server and the location where I run my build steps/scripts. One of the build steps wants to push a docker image to the Google Container Registry. While doing so it fails cause of […]

Categories
Development Google Google Cloud Storage Plugins XML

Segmentation fault with tensorboard 1.14

I am using deeplab network. I think it is using tensorflow 1.14 since there are still packages of slim, which is removed from tensorflow 2.0. The python version is always Python 3.6.8 in my case. I have sucessfullt run tensorboard from a venv(tensor2env) with tensorboard 2.0.1 tensorflow 2.0.0 tensorflow-estimator 2.0.1 But when I want to […]

Categories
Development Domain Google Google Cloud Storage

Internal server error using apache2 and google-cloud-storage

I managed to get everything hooked up.However i’m getting an internal error ;/ within the server.The error is in result of using storage_client= storage.Client() in the function hello within the function test “` storage_client= storage.Client()“` does work and python was able to find my secret.json file #__init__.py code from flask import Flask from google.cloud import […]

Categories
Development Django Google Google Cloud Storage

Django model FileField is set to “null” instead of url to the file when using Google Cloud Storage

I am running a File manager app on Local machine using Google Cloud Sql Proxy and storing the files in a Google Cloud Storage bucket. The file is being saved in the bucket, but the FileField is set to “null”. I want it to show the url by which I can access the file. I […]

Categories
Development Google Google Cloud Storage

Is Google Cloud Storage fast enough for serving images to mobile apps?

I have been using Google Cloud Storage to save photos that users upload from a mobile app (built with flutter and firebase), recently I had the need to resize/transform images and I wanted to explore if it’s possible to do it directly from google cloud storage! I found this project https://github.com/albertcht/python-gcs-image that you have to […]

Categories
Development Google Google Cloud Storage

GKE Config Connector StorageBucket resource times out on kubectl apply

I’m trying to apply the following StorageBucket resource from Google’s sample manifest: apiVersion: storage.cnrm.cloud.google.com/v1alpha2 kind: StorageBucket metadata: labels: label-one: “value-one” name: dmacthedestroyer-hdjkwhekhjewkjeh-storagebucket-sample spec: lifecycleRule: – action: type: Delete condition: age: 7 versioning: enabled: true cors: – origin: [“http://example.appspot.com”] responseHeader: [“Content-Type”] method: [“GET”, “HEAD”, “DELETE”] maxAgeSeconds: 3600 The response times out with the following errors: $ […]

Categories
API Development Google Google Cloud Storage

How to download a file as Blob from google drive using API

I have been working on a code that will download a blob from the google drive using their API(V3). I want to get this working as I need to duplicate the file from google drive to firebase storage by using the fileUrl/ fileID. I am able to export the pdf file after following a blog […]

Categories
Development Google Google Cloud Storage SQL

Google Cloud SQL and sql_mode flag

I am trying to run the following command gcloud beta sql instances create my_replica \ –master-instance-name=db-master01 \ –master-username=replication_user \ –master-password=’replication_password’ \ –master-dump-file-path=gs://path/to/dump.sql.gz \ –database-flags default_time_zone=’-05:00′ \ sql_mode=’STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION’ \ –region=us-central \ –tier=db-g1-small But I get the following error: ERROR: (gcloud.beta.sql.instances.create) unrecognized arguments: sql_mode=STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION To search the […]

Categories
Development Google Google Cloud Storage

Memory Error pulling blob from google Storage

I am using Docker Registry API (https://cloud.google.com/container-registry/docs/reference/docker-api) to pull blobs from the container registry of google. The blob size is around 900Mbs. While pulling this blob I get a memory error in Python as this : File “C:\Users\user1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\sessions.py”, line 686, in send r.content File “C:\Users\user1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\models.py”, line 828, in content self._content = b”.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b” MemoryError […]