I tried to Creating and Deploying Oracle Cloud Functions by following the official documentation instructions. I can create and deploy using java runtime but when I deploy go runtime always return error.
I tried to init Go function using this command in Oracle Cloud Shell:
fn init --runtime go hello-go
then I tried to deploy it
fn -v deploy --app test
but it returned error like below:
Deploying hello-go to app: test
Bumped to version 0.0.7
Building image bom.ocir.io/bmptwl2psusa/repo/hello-go:0.0.7
FN_REGISTRY: bom.ocir.io/bmptwl2psusa/repo
Current Context: ap-mumbai-1
Sending build context to Docker daemon 5.632kB
Step 1/10 : FROM fnproject/go:dev as build-stage
---> 96c8fb94a8e1
Step 2/10 : WORKDIR /function
---> Using cache
---> 8961dd299ec1
Step 3/10 : WORKDIR /go/src/func/
---> Using cache
---> 5a4c2c6e13f1
Step 4/10 : ENV GO111MODULE=on
---> Using cache
---> 22022ff2fcf8
Step 5/10 : COPY . .
---> 714622a6ff03
Step 6/10 : RUN cd /go/src/func/ && go build -o func
---> Running in 39fedbc476f4
build func: cannot find module for path github.com/fnproject/fdk-go
The command '/bin/sh -c cd /go/src/func/ && go build -o func' returned a non-zero code: 1
Fn: error running docker build: exit status 1
When I'm using java runtime with fn init --runtime java hello-java command, it's successfully deployed, Why always fail when using go?
I tried to run go build -o func in hello-go directory but it's returned:
go: finding module for package github.com/fnproject/fdk-go
go: writing stat cache: mkdir /usr/share/gocode/pkg: permission denied
go: downloading github.com/fnproject/fdk-go v0.0.3
func.go:10:2: mkdir /usr/share/gocode/pkg: permission denied
I know it happened because /usr/share/gocode/ directory is under root user, but I dont know how to change the permission on that folder because Oracle Cloud Shell can not use root user or sudo. (based on this answer)
Maybe I can do it if I use real VM shell or local shell/terminal, but I want to use Oracle Cloud Shell because I just followed official instructions that suggested me using Oracle Cloud Shell, so how to deploy Oracle Cloud Functions with Go runtime using Oracle Cloud Shell?
Mostly the official documentations only give the examples using Java runtime, that make me paranoid when using go.
This is a bug in cloudshell that we are figuring out the best way to solve.
As a short-term workaround you can do this once:
mkdir ${HOME}/gopath
Then set this in your terminal:
export GOPATH=${HOME}/gopath
You should probably edit your ~/.bashrc to set the GOPATH variable automatically so you don't forget
Related
I follow this guideline to deploy my python application.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-flask.html
I got this bug when use command eb deploy:
2021/09/10 17:26:49.653297 [INFO] extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/
2021/09/10 17:26:49.653315 [INFO] Running command /bin/sh -c /usr/bin/unzip -q -o /opt/elasticbeanstalk/deployment/app_source_bundle -d /var/app/staging/
2021/09/10 17:26:49.656613 [INFO] finished extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/ successfully
2021/09/10 17:26:49.657975 [ERROR] An error occurred during execution of command [app-deploy] - [StageApplication]. Stop running the command. Error: chown /var/app/staging/env/lib/python3.7/collections: no such file or directory
2021/09/10 17:26:49.657984 [INFO] Executing cleanup logic
2021/09/10 17:26:49.658080 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1631294809,"severity":"ERROR"}]}]}
its so annoy because it can not find python 3.7 to run. can anyone give me a hand to by pass this mess?
application.py
# app.py
from flask import Flask
application = Flask(__name__)
#application.route("/")
def hello():
return "Hello World!"
if __name__ == '__main__':
application.run()
requirements.txt
click==7.1.2
Flask==1.1.2
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
Werkzeug==1.0.1
This happened to me while following the tutorial as well.
The problem, in my case, was that my virtual environment folder venv was getting swept up in the deploy and breaking it.
I thought that I could put the path in .ebignore to prevent this, but I did not read the .ebignore documentation clearly:
If .ebignore isn't present, but .gitignore is, the EB CLI ignores files specified in .gitignore. If .ebignore is present, the EB CLI doesn't read .gitignore.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-configuration.html#eb-cli3-ebignore
In my case, I just removed the .ebignore file completely, added a line for venv into my .gitignore file, ran eb deploy again and everything worked.
I am unable to deploy a cloud function through google cloud build, receiving the error:
BUILD
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
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 1
My git repo structure is
myrepo/cloudbuild.yaml
myrepo/new-user/index.js
myrepo/new-user/package.json
And my cloudbuild.yaml is as follows
steps:
- name: 'gcr.io/cloud-builders/gcloud'
id: 'newUser'
args: ['functions',
'deploy',
'newUser',
'--source=./new-user/.',
'--trigger-event=providers/cloud.firestore/eventTypes/document.create',
'--trigger-resource=projects/myproject/databases/default/documents/userLocations/{user}',
'--runtime=nodejs8']
I thought for cloud functions, only the cloudbuild.yaml is required, which is why the Dockerfile error is confusing.
Running the following on the command line works fine.
gcloud functions deploy newUser --runtime=nodejs8 --trigger-event=providers/cloud.firestore/eventTypes/document.create --trigger-resource=projects/myproject/databases/default/documents/userLocations/{user} --source=./new-user/.
Thanks.
Your repository has no Dockerfile, so you cannot use a non-existent Dockerfile to build.
Since you are trying to make a serverless container that needs a Docker image as input.
As I just ran into this, the problem for me was linked to the fact that I was working in a monorepo and had to redefine the workspace location Cloud Build would use to find the Dockerfile by adding a dir to my cloudbuild file.
My Cloud Build trigger was setup to look for a cloudbuild file that was located under: <root>/apps/<subfolder>/cloudbuild.yaml
The cloudbuild file was properly picked up by CloudBuild, the build would start but then errored as the Dockerfile was not found.
YAML example:
steps:
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '-t', 'us-west2-docker.pkg.dev/$PROJECT_ID/quickstart-docker-repo/quickstart-image:tag1', '.' ]
images:
- 'us-west2-docker.pkg.dev/$PROJECT_ID/quickstart-docker-repo/quickstart-image:tag1'
- dir: 'apps/<subfolder>'
Reference: Docs
I am use juju in my openstack environment .
After reading docs about juju , I know that , I need generate-image and generate tools for prepareation .
So , below is my steps:
glance image-create .... ; this step works well and give out an image ID
juju metadata generate-image ... -d ./jujuopenstack ; this step works well
juju metadata generate-tools .. -d ./jujuopenstack ; this step works well
juju sync-tools --source="https://streams.canonical.com/juju/tools" --debug --show-log
this step FAILED ! and tell me that I NEED bootstrap openstack environment .
( I have no choice but to bootstrap my environment )
juju bootstrap --debug --metadata-source /home/john/juju -v --show-log --upload-tools
this step will lanch a new instance , and can ssh into it .
the log is :
... ...
Running apt-get update
Running apt-get upgrade
Installing package: curl
Installing package: cpu-checker
Installing package: bridge-utils
Installing package: rsyslog-gnutls
Bootstrapping Juju machine agent
... ....
juju.environs.simplestreams simplestreams.go:465
fetchData failed for "http://cloud-images.ubuntu.com/releases/streams/v1/mirrors.json": cannot find URL "http://cloud-images.ubuntu.com/releases/streams/v1/mirrors.json" not found
juju.environs.simplestreams simplestreams.go:542
no mirror index file found
juju.environs.simplestreams simplestreams.go:428
read metadata index at "http://cloud-images.ubuntu.com/releases/streams/v1/index.json"
juju.environs.simplestreams simplestreams.go:432
skipping index because of error getting latest metadata "http://cloud-images.ubuntu.com/releases/streams/v1/index.json": index file has no data for cloud {regionOne htxxxxxx.0.33:5000/v2.0/} not found
juju.cmd supercommand.go:323
cannot set initial environ constraints: index file has no data for cloud {regionOne httxxxxxx7.0.33:5000/v2.0/} not found
juju.cmd supercommand.go:323
failed to bootstrap environment: subprocess encountered error code 1
............
==============================================================
I have no choice , then rerun sync-tools
juju sync-tools --source="htxxxxxxstreams.canonical.com/juju/tools" --debug --show-log
but told me that :
error dialing "wssxxxxx72.27.0.50:17070/", will retry: websocket.Dial wss://172.27.0.50:17070/: dial tcp 172.27.0.50:17070: connection refused
===================
What I want to know and make clear is , do we need bootstrap before using sync-tools ?
thanks in advance .
I am trying to produce a memory (simple dual port ram) using core generator in xilinx 14.2. The problem is that during synthesis says :
ERROR:sim - Failed to run command ' -p xc3s100e-5cp132 -sd
"C:/Users/ORiON/register_file/ipcore_dir/tmp/_cg/_dbg/" -sd
"C:/Users/ORiON/register_file/ipcore_dir/tmp/_cg/" -dd
"C:/Users/ORiON/register_file/ipcore_dir/tmp/_cg/_dbg/" "MEM_aRd_sWr_16x32"
"C:/Users/ORiON/register_file/ipcore_dir/tmp/_cg/MEM_aRd_sWr_16x32.ngc"
-intstyle xflow'. Executable file not found.
ERROR:sim - Failed executing Tcl generator.
Wrote CGP file for project 'MEM_aRd_sWr_16x32'.
Core Generator create command failed.
ERROR:sim - Failed to generate 'MEM_aRd_sWr_16x32'. Failed executing Tcl
generator.
The command itself is missing.
Failed to run command 'A_COMMAND_SHOULD_BE_HERE -p xc3s100e-5cp132 -sd
I assume it's a kind of script or makefile who is calling this command and the command is defined as a variable. And the variable is not assigned. Something like that?
i installed sabayon linux and i tried to install pycuda but i am receiving the following error when i try
su -c "make install"
In file included from src/cpp/cuda.cpp:1:0: src/cpp/cuda.hpp:12:18:
fatal error: cuda.h: No such file or directory compilation terminated.
error: command 'x86_64-pc-linux-gnu-g++' failed with exit status 1
I must mention that i can compile with cuda.
The same happens and when i try with
sudo -E sh -c "make install"
My .bashrc is :
# Put your fun stuff here.
export PATH=~/bin:$PATH
export PATH=$PATH:$HOME/Matlab_2010b/bin
export PATH=/opt/cuda/bin:$PATH
export LD_LIBRARY_PATH=/opt/cuda/lib64:$LD_LIBRARY_PATH
export CUDA_ROOT=/opt/cuda/bin
(When i do echo $PATH as user it shows me : /opt/cuda/bin but when i try it as root it doesn't show anything and i had to do export PATH...again in order to show.)
You have CUDA installed in a non-standard path and the PyCUDA installer doesn't know how to find the toolkit headers it needs to compile. As per the installation instructions, you need to do something like this:
python configure.py --cuda-root=/opt/cuda
then
su -c "make install"
this will ensure that the compilation can find the necessary driver API headers to build the support libraries and hardcode all the right paths into the PyCUDA python libraries so that everything works correctly.