Viewing App engine Deployed files

66 views
Skip to first unread message

Mua Rachmann

unread,
Aug 26, 2019, 1:01:22 PM8/26/19
to Google App Engine
Hi everyone,

Have been working with the app engine for quite sometime now and have successfully uploaded my application (php - laravel 5.8) to the app engine which
works very fine. I have one issue of which i resolved locally but cant seem to resolve it on the app engine since i cant view my files or rather "cd into my projects root directory" as i will put it. It actually entails running the command ** Artisan::call('config:cache') so that my project's storage files can be loaded once again. i tried this by passing via a controller but this doesn't seem to work.

Question: How can i have access to my projects root directory via the cloud shell. opening this via cloud shell shows me other files like php-sample-docs etc but i can view my deployed files. Any help will be grateful thanks.

George (Cloud Platform Support)

unread,
Aug 26, 2019, 7:08:18 PM8/26/19
to Google App Engine
Hello Mua, 

Artisan is the command-line interface included with Laravel. What do you mean by "resolve it on the app engine"? You seem to say you have run Artisan commands locally, in your development environment, and you would like now to run the same commands to modify your deployed app's code, while running in the Cloud and offering service. This is not possible. If you modified your app locally, you can modify the deployed app's old version only by deploying the new version, and then transferring traffic to this deployed new version. 

If you want to see your deployed files, you can do that locally, as the deployed code is necessarily identical to the local code you deployed. 

Mua Rachmann

unread,
Aug 26, 2019, 7:27:15 PM8/26/19
to google-a...@googlegroups.com
Hello George,

Thanks for your prompt response.

Actually what I meant was viewing the deployed files from the cloud shell terminal. In my app.yaml file i place a key
APP_STORAGE = /tmp but in the cloud shell when I navigate to this i cant find the projects files.

Also i need this feature in production to be able to read the laravel logs founf in the **storage/framework/xxxxx.logs**
folder to be able to interprete some results there off. Could this be possible from the cloud. Generally what I do is a **tail -f .....**
which works but I need this  in production to simulate some stuffs.

Best,
Mua

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/33a57c5f-25f6-4f94-9c47-58b2a0b48dd1%40googlegroups.com.

George (Cloud Platform Support)

unread,
Aug 27, 2019, 2:07:33 PM8/27/19
to Google App Engine
Hello Mua, 

Where did you deploy your app? App Engine Standard, Flexible, Compute Engine VM? 

You should be aware that  /tmp is of temporary nature; moreover, the instance itself gets restarted from time to time, mainly for maintenance purposes. Saving files locally is not a solid long-term solution. The recommended solution consists in saving app data to Cloud Storage or Cloud SQL, where it is securely stored in permanent fashion.  

For Flexible, you may check Connecting to the instance page: 


To connect to an instance in the console:

  1. Visit the GCP Console instances page for your project:

    GO TO THE INSTANCES PAGE

  2. Click SSH in the far right of the row containing the instance you want to access:

    This puts the instance into debug mode, and opens an SSH session for the instance in a terminal window.

    You can also select different options to start an SSH session from the drop-down list.

  3. At this point you are in the instance host, which has several containers running in it. See Understanding common containers next for more information about these.
  4. In the terminal window, list the containers running in the instance:
    sudo docker ps
  5. The output of the sudo docker ps command lists each container by row; locate the row that contains your project ID: this is the container running your code. Note the NAME of this container.
  6. Optionally, list logging information for your application by invoking:
    sudo docker logs [CONTAINER-NAME]
  7. Start a shell in the container that is running your code:
    sudo docker exec -it [CONTAINER-NAME] /bin/bash
  8. When finished debugging, enter exit to exit the container, then exit again to exit the SSH session.
  9. Disable debugging for your instance to allow it to resume normal operation.



Reply all
Reply to author
Forward
0 new messages