Dockerfile not being found for Google cloud run - python

I've hit another bug. I'm now trying to set up continuous deployment for Google Cloud Run from my GitHub, and it's not finding my Dockerfile. I've tried various combinations with my file paths, but it still gives me the
Already have image (with digest): gcr.io/cloud-builders/docker
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /workspace/Dockerfile: no such file or directory
error.
This is my file structure from VSCode, and if I run the command from the first Exeplore folder, it finds the Dockerfile
The source directory is public, so I just can't figure out why it's not finding the Dockerfile.
https://github.com/Pierre-siddall/exeplore
Any advice at all would be greatly appreciated, thank you!
EDIT 1:
For some reason, the file path had some capitalisation that was different than what was on my VSCode - I suspect something on Github's end. Now I'm having issues getting the continuous deployment to actually update the page, but it is redeploying, but not updating now.

Related

Trying to run a Brownie Dapp in Docker

I'm trying to run my brownie dapp in a docker container, but i always have the same error and can't seem to fix it:
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/username/.brownie/packages/OpenZeppelin/openzeppelin-> > contracts#4.4.2/contracts/access/Ownable.sol'
I cloned the OpenZepplin folder with all the contracts to the work folder of my project and then remapped it like this:
dependencies:
- OpenZeppelin/openzeppelin-contracts#4.4.2
compiler:
solc:
remappings:
- "OpenZeppelin/openzeppelin-contracts#4.4.2/ = ./OpenZeppelin/openzeppelin-contracts#4.4.2/"
But it still gives the same error, and when I compile the contract, it is clearly still using the C:/Users/username/.brownie/packages/OpenZeppelin/openzeppelin-contracts#4.4.2/contracts folder. I know this because I tried to compile the contracts with a remapping to a non-existing folder:
remappings:
- "OpenZeppelin/openzeppelin-contracts#4.4.2/ = ./nothing/"
and it still compiled perfectly.
Just wondering if anybody could help me with this, and thank you in advance!
Ok, I just had the IDENTICAL issue as yourself. (I cloned a project and tried to run tests on my local machine, but got the same FileNotFoundError:)
But I managed to solve it.
First thing you need to have is Brownie itself (Obviously).
Second thing is installed OpenZeppelin packages inside Brownie.
Here is a link on how to set that up: #OpenZeppelin for Brownie
But in short, you just need this command:
brownie pm install OpenZeppelin/openzeppelin-contracts#4.4.2
MAKE SURE IT'S THE VERSION OF #OpenZeppelin YOU NEED !!
3.Final step is to go into your project's build/contracts directory and delete ALL smartContract.json files and then do brownie compile anew.
After that you can run test etc, it should work.
IN DEPT EXPLANATION:
The reason we were getting that error was because Brownie uses smartCotnract.json build files to run the tests, and to locate all of its own dependencies/packages. Those .json files also contain paths to all of it (including #OpenZeppelin package), and are generated during compile phase only if they don't already exist or the code had been edited in a specific contract. (That is why you need to delete them if you want for brownie compile to generate new ones)
Therefor if I compile it on my local machine and push those smartContract.json files to git, and you happen to clone all of it and run the compile/tests. It is highly unlikely it will work, as name-path on my local machine will differ. (Username is practically 100% bound to be different)

Xcode swift iOS project gives "usr/bin/python no such file or directory" error when try to build project

I am experiencing the problem after the macOS 12.3 Monterey update. I get the following error when I want to run the project. There is a code looking for "/usr/bin/python" in the project, but I couldn't find which part of code/framework/script etc. is looking for that path in my project. There is no problem in the path "usr/local/bin/python", but my project gives the error that I cannot find the path to "usr/bin/python". When I looked there, "/usr/bin/python3" exist. Unfortunately, since it is the system folder, I cannot make any changes(add or remove files or links) in that folder.
First you need to install python2. This can be done according to the guide
Then it is necessary in the file
{PATH_TO_PROJECT}/scripts/licenses/importLicensePods.py
replace the first line with #!/usr/bin/python to #!/usr/bin/local/python

execute python script using docker

I have a problem with docker. I have a docker image
docker images
and I want to execute a simple python script on the kakadadroid/python27-talib image. The script is located in /home/Elise/technical_indicator.py.
but when I try:
docker run --volume=$(pwd):/workspace kakadadroid/python27-talib:latest python home/Elise/technical_indicator
I have the following error:
python: can't open file 'home/Elise/technical_indicator.py': [Errno 2] No such file or directory
Can someone help me. I'm not an expert in docker.
Kind regards
Emmanuel
If you see your command line docker run --volume=$(pwd):/workspace kakadadroid/python27-talib:latest python home/Elise/technical_indicator it could have many causes. Try the following:
Your file path it's not correct. It should be /home/Elise/technical_indicator.py instead of home/Elise/technical_indicator.py. You've forgotten the / at the start of path specification.
The volume does not exist.
If the volume exists, the solution would be:
docker run --volume=$(pwd):/workspace kakadadroid/python27-talib:latest python /home/Elise/technical_indicator
Note: You should add your Dockerfile to let us understand better your problem.
Regards :)

svn: E155007: '/home/k/python/myproject_env/django-myproject/myproject' is not a working copy

I have been building django project and I want to use Subversion for version control on Ubuntu.
As you know, I need to keep most of the projects in the repository, however, some files and directories should only stay locally and not be tracked.
So I went to my project directory and typed the following command.
svn propedit svn:ignore myproject
But exception has occurred like this.
svn: E155007: '/home/k/python/myproject_env/django-myproject/myproject' is not a working copy
The path is ture that my app is located at /home/k/python/myproject_env/django-myproject/myproject
The guide says that when I type the command above, this will open a temporary file in the editor, where I need to put the following file and directory patterns for Subversion to ignore. But it doesn't work.
I already found the solution, but there is no answer anywhere.
I would like to know the solution. Thanks for your time.

Error adding local file to docker image with docker-py

I have been working with docker-py, in order to build images and launch containers all in one script. So far it has been very smooth. However, I am currently having issues with the ADD/COPY commands in the Dockerfile string variable.
I need to add a file from the source directory directly into the image. With standard Dockerfiles, I have been able to achieve this successfully, using the docker ADD command. But using docker-py, it throws the exception:
Exception: Error building docker image: lstat simrun.py: no such file or directory
The script simrun.py is stored in the same directory as the docker-py script, so I cannot understand why I would be receiving this exception. The relative line in dockerpy.py is:
ADD ./simrun.py /opt
Is there something that I've missed, or will this functionality just not work in docker-py yet?
You need to set the path in the docker build context using the path parameter.
See here

Categories