I am really suffering right now.. and I need to know why..
Somefiles (Excutable file like .exe) are not working if I do deploy with my commands. (And auto deploying with IntelliJ working perfectly after deploy)
and I really want to do same deploy like InteliJ does.
and here is the deploy code. above one is I did myself
and below one is IntelliJ did
I really want to do same with IntelliJ Auto Deploy
See code please
---- DO IT MANUALLY WITH COMMANDS
In short, I used this
gcloud builds submit --tag gcr.io/<PROJECT-ID>
gcloud run deploy --image gcr.io/<PROJECT-ID> --platform managed
In Long, Full Code
PS C:\go\abc-origin> gcloud builds submit --tag gcr.io/abc-b13a0/abc-origin
Creating temporary tarball archive of 82 file(s) totalling 9.3 MiB before compression.
Some files were not included in the source upload.
Check the gcloud log [C:\Users\abc\AppData\Roaming\gcloud\logs\2022.03.28\11.34.38.416229.log] to see which files and the contents of the
default gcloudignore file used (see `$ gcloud topic gcloudignore` to learn
more).
Uploading tarball of [.] to [gs://abc-b13a0_cloudbuild/source/1648434878.494229-ae5063c025314197813db4b93ec85691.tgz]
Created [https://cloudbuild.googleapis.com/v1/projects/abc-b13a0/locations/global/builds/313435fd-8c72-4230-9777-c9eb12b739fa].
Logs are available at [https://console.cloud.google.com/cloud-build/builds/313435fd-8c72-4230-9777-c9eb12b739fa?project=291094557957].
----------------------------------------------------------------------------------------- REMOTE BUILD OUTPUT ------------------------------------------------------------------------------------------
starting build "313435fd-8c72-4230-9777-c9eb12b739fa"
FETCHSOURCE
Fetching storage object: gs://abc-b13a0_cloudbuild/source/1648434878.494229-ae5063c025314197813db4b93ec85691.tgz#1648434880757751
Copying gs://abc-b13a0_cloudbuild/source/1648434878.494229-ae5063c025314197813db4b93ec85691.tgz#1648434880757751...
/ [1 files][ 8.6 MiB/ 8.6 MiB]
Operation completed over 1 objects/8.6 MiB.
BUILD
Already have image (with digest): gcr.io/cloud-builders/docker
Sending build context to Docker daemon 899.1kB
Step 1/7 : FROM node:17-slim
17-slim: Pulling from library/node
ae13dd578326: Pulling fs layer
a0bc29d3bc64: Pulling fs layer
d0e0f1a959b4: Pulling fs layer
fe23f6dccded: Pulling fs layer
f23aa4f1504d: Pulling fs layer
fe23f6dccded: Waiting
f23aa4f1504d: Waiting
a0bc29d3bc64: Download complete
fe23f6dccded: Verifying Checksum
fe23f6dccded: Download complete
ae13dd578326: Verifying Checksum
ae13dd578326: Download complete
f23aa4f1504d: Verifying Checksum
f23aa4f1504d: Download complete
d0e0f1a959b4: Verifying Checksum
d0e0f1a959b4: Download complete
ae13dd578326: Pull complete
a0bc29d3bc64: Pull complete
d0e0f1a959b4: Pull complete
fe23f6dccded: Pull complete
f23aa4f1504d: Pull complete
Digest: sha256:3894373926629c8e2c437314fb253b5d261efa6bddb2c947474406470fee2890
Status: Downloaded newer image for node:17-slim
---> 83d5dcf3f6f6
Step 2/7 : WORKDIR /usr/src/app
---> Running in addca1bcb85e
Removing intermediate container addca1bcb85e
---> e0568396db62
Step 3/7 : COPY . .
---> ff239f669d09
Step 4/7 : COPY . ./
---> 78544462e12c
Step 5/7 : RUN npm install
---> Running in 2e558015a5d5
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated sane#4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated #types/mongoose#5.11.97: Mongoose publishes its own types, so you do not need to install this package.
npm WARN deprecated #types/helmet#4.0.0: This is a stub types definition. helmet provides its own type definitions, so you do not need this installed.
npm WARN deprecated #types/iconv-lite#0.0.1: This is a stub types definition for iconv-lite (https://github.com/ashtuchkin/iconv-lite). iconv-lite provides its own type definitions, so you don\'t need
#types/iconv-lite installed!
npm WARN deprecated #hapi/pinpoint#2.0.0: Moved to 'npm install #sideway/pinpoint'
npm WARN deprecated #hapi/formula#2.0.0: Moved to 'npm install #sideway/formula'
npm WARN deprecated #hapi/address#4.1.0: Moved to 'npm install #sideway/address'
npm WARN deprecated #hapi/joi#17.1.1: Switch to 'npm install joi'
npm WARN deprecated tslint#6.1.3: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
added 1011 packages, and audited 1012 packages in 55s
77 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Removing intermediate container 2e558015a5d5
---> 5d7ff12b8075
Step 6/7 : RUN npm run build
---> Running in a2c0d89306c7
> nodejs-cloud-run-hello-world#0.0.1 build
> tsc --build
Removing intermediate container a2c0d89306c7
---> 96d13c4da119
Step 7/7 : CMD ["npm","start"]
---> Running in 3aaafeaa519c
Removing intermediate container 3aaafeaa519c
---> 0ffe22dfcae7
Successfully built 0ffe22dfcae7
Successfully tagged gcr.io/abc-b13a0/abc-origin:latest
PUSH
Pushing gcr.io/abc-b13a0/abc-origin
The push refers to repository [gcr.io/abc-b13a0/abc-origin]
1536374452a8: Preparing
6b04bb227785: Preparing
e86eb4a3c682: Preparing
5f8624a6a2ac: Preparing
05d059f19b02: Preparing
40ed0919f5f8: Preparing
016b2cae399b: Preparing
fd91c8bc8266: Preparing
009cb98a6eb1: Preparing
3a626bb08c24: Preparing
40ed0919f5f8: Waiting
016b2cae399b: Waiting
fd91c8bc8266: Waiting
009cb98a6eb1: Waiting
3a626bb08c24: Waiting
5f8624a6a2ac: Pushed
e86eb4a3c682: Pushed
05d059f19b02: Pushed
1536374452a8: Pushed
40ed0919f5f8: Layer already exists
009cb98a6eb1: Layer already exists
fd91c8bc8266: Layer already exists
016b2cae399b: Layer already exists
3a626bb08c24: Layer already exists
6b04bb227785: Pushed
latest: digest: sha256:926c748640d78c396863bdf6fa8c246247bf0619e5a2764e87827f605349f6bc size: 2415
DONE
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ID CREATE_TIME DURATION SOURCE IMAGES
STATUS
313435fd-8c72-4230-9777-c9eb12b739fa 2022-03-28T02:34:41+00:00 1M49S gs://abc-b13a0_cloudbuild/source/1648434878.494229-ae5063c025314197813db4b93ec85691.tgz gcr.io/abc-b13a0/abc-origin
(+1 more) SUCCESS
PS C:\go\abc-origin> gcloud run deploy --image gcr.io/abc-b13a0/abc-origin --platform managed
---- INTELLIJ AUTO CLOUD RUN DEPLOYING DEFAULT
C:\Users\Abc\AppData\Local\google\ct4j-cloud-sdk\LATEST\google-cloud-sdk\bin\gcloud.cmd run deploy abc-origin --quiet --image gcr.io/abc-b13a0/abc-origin --platform managed --project abc-b13a0 --memory 256Mi --timeout 300 --concurrency 80 --max-instances 1000 --cpu 1 --clear-env-vars --clear-cloudsql-instances --client-name "Cloud Code for IntelliJ" --client-version 22.2.1-213 --region asia-northeast1 --allow-unauthenticated --clear-vpc-connector
Preparing Google Cloud SDK (this may take several minutes for first time setup)...
Creating skaffold file: C:\Users\Abc\AppData\Local\Temp\skaffold5770358230968925998.tmp...
Configuring image push settings in C:\Users\Abc\AppData\Local\Temp\skaffold5770358230968925998.tmp...
C:\Users\Abc\AppData\Local\cloud-code\bin\versions\06e58efc4201989233a521d3211c1a2558e7db7b947e23aa203e5d2e46c990d3\skaffold.exe build --filename C:\Users\Abc\AppData\Local\Temp\skaffold5770358230968925998.tmp --tag latest --skip-tests=true
Generating tags...
- gcr.io/abc-b13a0/abc-origin -> gcr.io/abc-b13a0/abc-origin:latest
Checking cache...
- gcr.io/abc-b13a0/abc-origin: Not found. Building
Starting build...
Building [gcr.io/abc-b13a0/abc-origin]...
Pushing code to gs://abc-b13a0_cloudbuild/source/abc-b13a0-5556f485-72cc-4ccf-967d-bfdd1d0d5329.tar.gz
Logs are available at
https://console.cloud.google.com/m/cloudstorage/b/abc-b13a0_cloudbuild/o/log-99f843b0-8ff0-4e4e-99d8-7abdc7bf30e4.txt
starting build "99f843b0-8ff0-4e4e-99d8-7abdc7bf30e4"
FETCHSOURCE
Fetching storage object: gs://abc-b13a0_cloudbuild/source/abc-b13a0-5556f485-72cc-4ccf-967d-bfdd1d0d5329.tar.gz#1648433508081094
Copying gs://abc-b13a0_cloudbuild/source/abc-b13a0-5556f485-72cc-4ccf-967d-bfdd1d0d5329.tar.gz#1648433508081094...
/ [1 files][ 9.2 MiB/ 9.2 MiB]
Operation completed over 1 objects/9.2 MiB.
BUILD
Already have image (with digest): gcr.io/cloud-builders/docker
Sending build context to Docker daemon 10.54MB
Step 1/7 : FROM node:17-slim
17-slim: Pulling from library/node
ae13dd578326: Pulling fs layer
a0bc29d3bc64: Pulling fs layer
d0e0f1a959b4: Pulling fs layer
fe23f6dccded: Pulling fs layer
f23aa4f1504d: Pulling fs layer
fe23f6dccded: Waiting
f23aa4f1504d: Waiting
a0bc29d3bc64: Verifying Checksum
a0bc29d3bc64: Download complete
fe23f6dccded: Verifying Checksum
fe23f6dccded: Download complete
ae13dd578326: Verifying Checksum
ae13dd578326: Download complete
f23aa4f1504d: Verifying Checksum
f23aa4f1504d: Download complete
d0e0f1a959b4: Verifying Checksum
d0e0f1a959b4: Download complete
ae13dd578326: Pull complete
a0bc29d3bc64: Pull complete
d0e0f1a959b4: Pull complete
fe23f6dccded: Pull complete
f23aa4f1504d: Pull complete
Digest: sha256:3894373926629c8e2c437314fb253b5d261efa6bddb2c947474406470fee2890
Status: Downloaded newer image for node:17-slim
---> 83d5dcf3f6f6
Step 2/7 : WORKDIR /usr/src/app
---> Running in 5c7029771a25
Removing intermediate container 5c7029771a25
---> 7b2ba07f192a
Step 3/7 : COPY . .
---> 8e1720a22a0a
Step 4/7 : COPY . ./
---> 3437788621d6
Step 5/7 : RUN npm install
---> Running in 77bc58474b9a
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated sane#4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated #types/helmet#4.0.0: This is a stub types definition. helmet provides its own type definitions, so you do not need this installed.
npm WARN deprecated #types/mongoose#5.11.97: Mongoose publishes its own types, so you do not need to install this package.
npm WARN deprecated #types/iconv-lite#0.0.1: This is a stub types definition for iconv-lite (https://github.com/ashtuchkin/iconv-lite). iconv-lite provides its own type definitions, so you don\'t need #types/iconv-lite installed!
npm WARN deprecated #hapi/formula#2.0.0: Moved to 'npm install #sideway/formula'
npm WARN deprecated #hapi/pinpoint#2.0.0: Moved to 'npm install #sideway/pinpoint'
npm WARN deprecated #hapi/address#4.1.0: Moved to 'npm install #sideway/address'
npm WARN deprecated #hapi/joi#17.1.1: Switch to 'npm install joi'
npm WARN deprecated tslint#6.1.3: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
added 1011 packages, and audited 1012 packages in 58s
77 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Removing intermediate container 77bc58474b9a
---> 716aa89b15ed
Step 6/7 : RUN npm run build
---> Running in 88daa40576c1
> nodejs-cloud-run-hello-world#0.0.1 build
> tsc --build
Removing intermediate container 88daa40576c1
---> f06d20cb4695
Step 7/7 : CMD ["npm","start"]
---> Running in 114dccd18b7b
Removing intermediate container 114dccd18b7b
---> 44eae9ff6f01
Successfully built 44eae9ff6f01
Successfully tagged gcr.io/abc-b13a0/abc-origin:latest
PUSH
Pushing gcr.io/abc-b13a0/abc-origin:latest
The push refers to repository [gcr.io/abc-b13a0/abc-origin]
5ca13cc3b48f: Preparing
7e236c8bde4e: Preparing
da179f551c57: Preparing
bf4615d388ff: Preparing
c349e402c854: Preparing
40ed0919f5f8: Preparing
016b2cae399b: Preparing
fd91c8bc8266: Preparing
009cb98a6eb1: Preparing
3a626bb08c24: Preparing
40ed0919f5f8: Waiting
016b2cae399b: Waiting
fd91c8bc8266: Waiting
009cb98a6eb1: Waiting
3a626bb08c24: Waiting
c349e402c854: Pushed
40ed0919f5f8: Layer already exists
5ca13cc3b48f: Pushed
fd91c8bc8266: Layer already exists
016b2cae399b: Layer already exists
009cb98a6eb1: Layer already exists
3a626bb08c24: Layer already exists
bf4615d388ff: Pushed
da179f551c57: Pushed
7e236c8bde4e: Pushed
latest: digest: sha256:efe017d86ad7a5f43a800b3acdb9519f1a0cf6aefc80d0291ba2f84fc32c08fa size: 2417
DONE
C:\Users\Abc\AppData\Local\google\ct4j-cloud-sdk\LATEST\google-cloud-sdk\bin\gcloud.cmd run deploy abc-origin --quiet --image gcr.io/abc-b13a0/abc-origin --platform managed --project abc-b13a0 --memory 256Mi --timeout 300 --concurrency 80 --max-instances 1000 --cpu 1 --clear-env-vars --clear-cloudsql-instances --client-name "Cloud Code for IntelliJ" --client-version 22.2.1-213 --region asia-northeast1 --allow-unauthenticated --clear-vpc-connector
Deploying container to Cloud Run service [abc-origin] in project [abc-b13a0]
If IntelliJ does, it also declares a strange skaffold build statement. I want to follow IntelliJ for everything. How exactly should I run the command? I cannot rely on AUTO DEPLOY every time.
DOCKERFILE
FROM node:17-slim
WORKDIR /usr/src/app
COPY . .
COPY . ./
RUN npm install
RUN npm run build
CMD ["npm","start"]
A .tar.gz file is always a simple archive of files, very much like a standard WinZip file. In the general UNIX world, a .tgz file is actually the same as a .tar.gz file. You can freely switch the extensions of these two without affecting the uncompression of the file. For more on this, you may refer to the link.
Now, coming to the deployment issue, as mentioned in the documentation,
To submit a build with local source source.tgz asynchronously:
gcloud builds submit "source.tgz" --tag=gcr.io/my-project/image --async
Also, have a look at this Stackoverflow case.
I realized that the Cloud Code provided by GCP is a bit more futuristic than what can be solved with commands in the terminal. (more compatible in various ways) I've decided that intellij, vscode, or a shell editor is the best choice and there is no alternative for now.
--ADD
I just checked cloud shell editor cloud run deploy using cloud code. and it is not working too (can`t excute some program like I said in this question) I cloned from cloud source repository so, it is same code. (I checked)
What makes IntelliJ cloud code special exactly? I wonder
Why only this works..
Related
.. aaaand me again :)
This time with a very interesting problem.
Again AWS Lambda function, node.js 12, Javascript, Ubuntu 18.04 for local development, aws cli/aws sam/Docker/IntelliJ, everything is working perfectly in local and is time to deploy.
So I did set up an AWS account for tests, created and assigned an access key/secret and finally did try to deploy.
Almost at the end an error pop up aborting the deployment.
I'm showing the SAM cli version from a terminal, but the same happens with IntelliJ.
(of course I mask/change some names)
From a terminal I'm going where I have my local sandbox with the project and then :
$ sam deploy --guided
Configuring SAM deploy
======================
Looking for config file [samconfig.toml] : Not found
Setting default arguments for 'sam deploy'
=========================================
Stack Name [sam-app]: MyActualProjectName
AWS Region [us-east-1]: us-east-2
#Shows you resources changes to be deployed and require a 'Y' to initiate deploy
Confirm changes before deploy [y/N]: y
#SAM needs permission to be able to create roles to connect to the resources in your template
Allow SAM CLI IAM role creation [Y/n]: y
Save arguments to configuration file [Y/n]: y
SAM configuration file [samconfig.toml]: y
SAM configuration environment [default]:
Looking for resources needed for deployment: Not found.
Creating the required resources...
Successfully created!
Managed S3 bucket: aws-sam-cli-managed-default-samclisourcebucket-7qo1hy7mdu9z
A different default S3 bucket can be set in samconfig.toml
Saved arguments to config file
Running 'sam deploy' for future deployments will use the parameters saved above.
The above parameters can be changed by modifying samconfig.toml
Learn more about samconfig.toml syntax at
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-config.html
Error: Unable to upload artifact MyFunctionName referenced by CodeUri parameter of MyFunctionName resource.
ZIP does not support timestamps before 1980
$
I spent quite some time looking around for this problem but I found only some old threads.
In theory this problems was solved in 2018 ... but probably some npm libraries I had to use contains something old ... how in the world I fix this stuff ?
In one thread I found a kind of workaround.
In the file buildspec.yml somebody suggested to add AFTER the npm install :
ls $CODEBUILD_SRC_DIR
find $CODEBUILD_SRC_DIR/node_modules -mtime +10950 -exec touch {} ;
Basically the idea is to touch all the files installed after the npm install but still the error happens.
This my buildspec.yml file after the modification :
version: 0.2
phases:
install:
commands:
# Install all dependencies (including dependencies for running tests)
- npm install
- ls $CODEBUILD_SRC_DIR
- find $CODEBUILD_SRC_DIR/node_modules -mtime +10950 -exec touch {} ;
pre_build:
commands:
# Discover and run unit tests in the '__tests__' directory
- npm run test
# Remove all unit tests to reduce the size of the package that will be ultimately uploaded to Lambda
- rm -rf ./__tests__
# Remove all dependencies not needed for the Lambda deployment package (the packages from devDependencies in package.json)
- npm prune --production
build:
commands:
# Use AWS SAM to package the application by using AWS CloudFormation
- aws cloudformation package --template template.yml --s3-bucket $S3_BUCKET --output-template template-export.yml
artifacts:
type: zip
files:
- template-export.yml
I will continue to search but again I wonder if somebody here had this kind of problem and thus some suggestions/methodology about how to solve it.
Many many thanks !
Steve
From the link below:
https://cloud.google.com/run/docs/quickstarts/build-and-deploy#shell_1;
I am going through a tutorial on how to deploy an app on Cloud Run, and I keep having errors. see details below:
Quickstart: Build and Deploy
Directory: helloworld-shell
Files in Directory:
script.sh
invoke.go
Dockerfile
Code of each file
Script Code
script.sh
#!/bin/sh
echo Hello ${TARGET:=World}!
Invoke Code:
invoke.go
package main
import (
"fmt"
"log"
"net/http"
"os"
"os/exec"
)
func handler(w http.ResponseWriter, r *http.Request) {
log.Print("helloworld: received a request")
cmd := exec.CommandContext(r.Context(), "/bin/sh", "script.sh")
cmd.Stderr = os.Stderr
out, err := cmd.Output()
if err != nil {
w.WriteHeader(500)
}
w.Write(out)
}
func main() {
log.Print("helloworld: starting server...")
http.HandleFunc("/", handler)
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
log.Printf("helloworld: listening on %s", port)
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), nil))
}
Dockerfile
# Use the official Golang image to create a build artifact.
# This is based on Debian and sets the GOPATH to /go.
# https://hub.docker.com/_/golang
FROM golang:1.13 as builder
# Create and change to the app directory.
WORKDIR /app
# Retrieve application dependencies using go modules.
# Allows container builds to reuse downloaded dependencies.
COPY go.* ./
RUN go mod download
# Copy local code to the container image.
COPY invoke.go ./
# Build the binary.
# -mod=readonly ensures immutable go.mod and go.sum in container builds.
RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o server
# Use the official Alpine image for a lean production container.
# https://hub.docker.com/_/alpine
# https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds
FROM alpine:3
RUN apk add --no-cache ca-certificates
# Copy the binary to the production image from the builder stage.
COPY --from=builder /app/server /server
COPY script.sh ./
# Run the web service on container startup.
CMD ["/server"]
After running the build cmd on the cloud shell, as below:
gcloud builds submit --tag gcr.io/ultra-complex-282611/helloworld
I keep getting output as below:
sunny#cloudshell:~/helloworld-shell (ultra-complex-282611)$ gcloud builds submit --tag gcr.io/ultra-complex-282611/helloworld-shell/script.sh
Creating temporary tarball archive of 3 file(s) totalling 1.8 KiB before compression.
Uploading tarball of [.] to [gs://ultra-complex-282611_cloudbuild/source/1595280001.548751-6f55216d642d438a82392a7ae1688fbe.tgz]
Created [https://cloudbuild.googleapis.com/v1/projects/ultra-complex-282611/builds/ec154f13-cc1e-4082-bcc0-e47804d201cb].
Logs are available at [https://console.cloud.google.com/cloud-build/builds/ec154f13-cc1e-4082-bcc0-e47804d201cb?project=413771885505].
---------------------------------------------------------------------------- REMOTE BUILD OUTPUT ----------------------------------------------------------------------------
starting build "ec154f13-cc1e-4082-bcc0-e47804d201cb"
FETCHSOURCE
Fetching storage object: gs://ultra-complex-282611_cloudbuild/source/1595280001.548751-6f55216d642d438a82392a7ae1688fbe.tgz#1595280009304068
Copying gs://ultra-complex-282611_cloudbuild/source/1595280001.548751-6f55216d642d438a82392a7ae1688fbe.tgz#1595280009304068...
/ [1 files][ 1.1 KiB/ 1.1 KiB]
Operation completed over 1 objects/1.1 KiB.
BUILD
Already have image (with digest): gcr.io/cloud-builders/docker
***** NOTICE *****
Alternative official `docker` images, including multiple versions across
multiple platforms, are maintained by the Docker Team. For details, please
visit https://hub.docker.com/_/docker.
***** END OF NOTICE *****
Sending build context to Docker daemon 5.632kB
Step 1/11 : FROM golang:1.13 as builder
1.13: Pulling from library/golang
e9afc4f90ab0: Already exists
989e6b19a265: Already exists
af14b6c2f878: Already exists
5573c4b30949: Already exists
d4020e2aa747: Already exists
78b4a3dfc225: Pulling fs layer
2ade102f7410: Pulling fs layer
2ade102f7410: Verifying Checksum
2ade102f7410: Download complete
78b4a3dfc225: Verifying Checksum
2ade102f7410: Download complete
78b4a3dfc225: Verifying Checksum
78b4a3dfc225: Download complete
78b4a3dfc225: Pull complete
2ade102f7410: Pull complete
Digest: sha256:ffb07735793859dc30a06503eb4cbc5c9523b1477ac55155c61a2285abd4c89d
Status: Downloaded newer image for golang:1.13
---> afae231e0b45
Step 2/11 : WORKDIR /app
---> Running in 5f7bae1883f6
Removing intermediate container 5f7bae1883f6
---> 3405fccd5cd0
Step 3/11 : COPY go.* ./
COPY failed: no source files were specified
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ERROR: (gcloud.builds.submit) build ec154f13-cc1e-4082-bcc0-e47804d201cb completed with status "FAILURE"
How else am I supposed to specify the source file?
I had the same issue. I solved it by creating the go.mod file in the directory helloworld-shell shown in the go tab of the documentation, this allowed for the build to succeed.
module github.com/knative/docs/docs/serving/samples/hello-world/helloworld-go
go 1.13
You should have the following files:
Dockerfile go.mod invoke.go script.sh
I have just started working with AWS. I am trying to deploy a nodejs application using codeship and AWS codedeploy. I am successful in deploying the application from codeship to Ec2 instance. But the problem is that I am not able to run the hooks file in appspec.yml. My appspec.yml is given below:
---
version: 0.0
os: linux
files:
- destination: /home/ec2-user/node-project
source: /
hooks:
ApplicationStart:
- location: bin/app-start.sh
runas: root
timeout: 100
In app-start.sh I have:
#!/bin/bash
npm install
The app-start.sh never works and node-modules are never installed. I have also tried to debug in the logs path(/var/log/aws/codedeploy-agent/codedeploy-agent.log) for code-deploy but there is no error and warning.I have also tried multiple things but nothing is working.
The project is successfully installed in Ec2 instance but appspec.yml never launches app-start.sh. Any help would be appreciated.
The issue is that you're moving the files to /home/ec2-user/node-project, which happens before your app-start.sh gets run at the ApplicationStart lifecycle hook. You need to cd into the right directory before running npm install.
Updated ApplicationStart scripts:
#!/bin/bash
cd /home/ec2-user/node-project
npm install
# You'll need to start your application too.
npm start
As an aside, you may want to use the AfterInstall lifecycle hook to run npm install just for organization purposes, but it will have no functional different.
I have created a ruby env on amazon elastic beanstalk, but when I try to deploy my rails app from command line using eb deploy I get this error:
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
You need to install git to be able to use gems from git repositories. For help
installing git, please refer to GitHub's tutorial at
https://help.github.com/articles/set-up-git (Executor::NonZeroExitStatus)
[2015-08-09T15:50:38.513Z] INFO [4217] - [CMD-AppDeploy/AppDeployStage0/AppDeployPreHook/10_bundle_install.sh] : Activity failed.
[2015-08-09T15:50:38.513Z] INFO [4217] - [CMD-AppDeploy/AppDeployStage0/AppDeployPreHook] : Activity failed.
[2015-08-09T15:50:38.513Z] INFO [4217] - [CMD-AppDeploy/AppDeployStage0] : Activity failed.
[2015-08-09T15:50:38.514Z] INFO [4217] - [CMD-AppDeploy] : Completed activity. Result:
Command CMD-AppDeploy failed.
So, shall I install git at amazon instance bash directly? will this effect autoscaling?
I don't know if you fixed this, but you need to tell Elastic Beanstalk to install git.
In the root directory of your project, add a folder called .ebextensions.
Create a file inside that folder called (something like) install_git.config (the .config is important).
Add the following lines to that file:
packages:
yum:
git: []
Then redeploy your application, and you shouldn't see that error anymore.
I am trying to create an automated build with docker. What I have done is linked my bit-bucket repo in the docker hub and trying to build. The status of build is unexpected failure. Also, I see the below failure message:
{"error": "Image depends on an unauthorized parent"}
And interestingly, the logs says build successful.
Failure message
[Failure instance: Traceback: <type 'exceptions.RuntimeError'>: HTTP code 400 while uploading metadata: {"error": "Image depends on an unauthorized parent"}
/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py:382:callback
/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py:490:_startRunCallbacks
/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py:577:_runCallbacks
/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py:1155:gotResult
--- <exception caught here> ---
/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py:1097:_inlineCallbacks
/usr/local/lib/python2.7/dist- packages/twisted/python/failure.py:389:throwExceptionIntoGenerator
/app/builder.py:160:execute_job
/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py:577:_runCallbacks
/app/shared/tx/docker.py:295:on_done
]
Dockerfile
FROM ubuntu
# make sure the package repository is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
# Install vnc, xvfb in order to create a 'fake' display and firefox
RUN apt-get install -y x11vnc xvfb firefox
RUN mkdir /.vnc
# Setup a password
RUN x11vnc -storepasswd 1234 ~/.vnc/passwd
# Autostart firefox (might not be the best way, but it does the trick)
RUN bash -c 'echo "firefox" >> /.bashrc'
EXPOSE 5900
CMD ["x11vnc", "-forever", "-usepw", "-create"]
Logs
Step 0 : FROM ubuntu
Pulling image (quantal) from ubuntu, endpoint: https://cdn-registry-1.docker.io/v1/ e314931015bd
....
....
Removing intermediate container c8e48d27a271
Step 8 : CMD ["x11vnc", "-forever", "-usepw", "-create"]
---> Running in d9319762cb0f
---> bd7eb37a7f78
Removing intermediate container d9319762cb0f
Successfully built bd7eb37a7f78
Update: The issue was fixed.
I just got an answer from the Docker support team. It's an issue on their side, which they are already investigating.
Unfortunately there isn't much you can do besides waiting.