influx shell v1 keeps giving error Error: retention policy not found: autogen - influxdb

I am trying to get records from influxdb using influx shell
When I try to do a query SELECT * FROM bucketname.autogen.measuermentname
I get error Error: retention policy not found: autogen
when inspect retention policies for my bucket using SHOW RETENTION POLICIES ON bucketname I get
┃ index ┃ name ┃ duration ┃ shardGroupDuration ┃ replicaN ┃ default ┃
┣━━━━━━━╋━━━━━━━━━╋━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━╋━━━━━━━━━┫
┃ 1┃autogen ┃0s ┃168h0m0s ┃ 1.0000000000┃ true┃
so the retention policy is there but the shell doesn't pick it up.
lastly, I tried to create a new retention policy as well, using CREATE RETENTION POLICY "2year" ON "bucketname" DURATION 94w REPLICATION 1;
but this causes yet another error
Error: not implemented: CREATE RETENTION POLICY
InfluxDB version: v2.4.0

Related

sam build --use-container failed but sam build is success

The issue happens in the following setup:
Virtual Machine launched in OpenStack
OS is Ubuntu 16.04 LTS
Python version 3.7.6 with virtualenv installed
SAM CLI version 0.39.0
To replicate the issues, you may use the above setup and perform the following steps:
$ sam init
$ Choice: 1
$ Runtime 9 Select python3.7
$ Project name[sam-app]: sam-app
$ Template selection: 1 Select Hello World Example
Wait for the application to be generated.
$ cd sam-app
$ python3 -m virtualenv venv
$ source venv/bin/activate
$(venv) source venv/bin/activate
$(venv) sam build
The following output shall appear:
Building resource 'HelloWorldFunction'
Running PythonPipBuilder:ResolveDependencies
Running PythonPipBuilder:CopySource
Build Succeeded
Built Artifacts : .aws-sam/build
Built Template : .aws-sam/build/template.yaml
Commands you can use next
=========================
[*] Invoke Function: sam local invoke
[*] Deploy: sam deploy --guided
However, if the --use-container flag is used, the following error will appear
Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
'build' command is called
Starting Build inside a container
No Parameters detected in the template
2 resources found in the template
Found Serverless function with name='HelloWorldFunction' and CodeUri='hello_world/'
Building resource 'HelloWorldFunction'
Fetching lambci/lambda:build-python3.7 Docker container image......
Mounting /home/ubuntu/test/sam-app/hello_world as /tmp/samcli/source:ro,delegated inside runtime container
Using the request object from command line argument
Loading workflow module 'aws_lambda_builders.workflows'
Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
Registering workflow 'GoDepBuilder' with capability 'Capability(language='go', dependency_manager='dep', application_framework=None)'
Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
Found workflow 'PythonPipBuilder' to support capabilities 'Capability(language='python', dependency_manager='pip', application_framework=None)'
Running workflow 'PythonPipBuilder'
Running PythonPipBuilder:ResolveDependencies
calling pip download -r /tmp/samcli/source/requirements.txt --dest /tmp/samcli/scratch
PythonPipBuilder:ResolveDependencies failed
Traceback (most recent call last):
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 42, in execute
requirements_path=self.manifest_path,
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 137, in build_dependencies
self._dependency_builder.build_site_packages(requirements_path, artifacts_dir_path, scratch_dir_path)
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 198, in build_site_packages
wheels, packages_without_wheels = self._download_dependencies(scratch_directory, requirements_filepath)
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 222, in _download_dependencies
deps = self._download_all_dependencies(requirements_filename, directory)
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 305, in _download_all_dependencies
self._pip.download_all_dependencies(requirements_filename, directory)
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 594, in download_all_dependencies
raise NoSuchPackageError(str(package_name))
aws_lambda_builders.workflows.python_pip.packager.NoSuchPackageError: Could not satisfy the requirement: requests
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflow.py", line 269, in run
action.execute()
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 45, in execute
raise ActionFailedError(str(ex))
aws_lambda_builders.actions.ActionFailedError: Could not satisfy the requirement: requests
Builder workflow failed
Traceback (most recent call last):
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 42, in execute
requirements_path=self.manifest_path,
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 137, in build_dependencies
self._dependency_builder.build_site_packages(requirements_path, artifacts_dir_path, scratch_dir_path)
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 198, in build_site_packages
wheels, packages_without_wheels = self._download_dependencies(scratch_directory, requirements_filepath)
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 222, in _download_dependencies
deps = self._download_all_dependencies(requirements_filename, directory)
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 305, in _download_all_dependencies
self._pip.download_all_dependencies(requirements_filename, directory)
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 594, in download_all_dependencies
raise NoSuchPackageError(str(package_name))
aws_lambda_builders.workflows.python_pip.packager.NoSuchPackageError: Could not satisfy the requirement: requests
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflow.py", line 269, in run
action.execute()
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 45, in execute
raise ActionFailedError(str(ex))
aws_lambda_builders.actions.ActionFailedError: Could not satisfy the requirement: requests
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/__main__.py", line 126, in main
mode=params.get("mode", None),
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/builder.py", line 125, in build
return workflow.run()
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflow.py", line 76, in wrapper
func(self, *args, **kwargs)
File "/var/lang/lib/python3.7/site-packages/aws_lambda_builders/workflow.py", line 276, in run
raise WorkflowFailedError(workflow_name=self.NAME, action_name=action.NAME, reason=str(ex))
aws_lambda_builders.exceptions.WorkflowFailedError: PythonPipBuilder:ResolveDependencies - Could not satisfy the requirement: requests
Build inside container returned response {"jsonrpc": "2.0", "id": 1, "error": {"code": 400, "message": "PythonPipBuilder:ResolveDependencies - Could not satisfy the requirement: requests"}}
Build Failed
Sending Telemetry: {'metrics': [{'commandRun': {'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam build', 'duration': 107282, 'exitReason': 'BuildError', 'exitCode': 1, 'requestId': '62d1fc73-70e5-4592-8c78-8fa273684592', 'installationId': 'ce8ffa14-684f-4628-97fe-288848fcf73d', 'sessionId': '4ca5bb42-5cf1-4ae5-89ad-9ed00366fefb', 'executionEnvironment': 'CLI', 'pyversion': '3.7.6', 'samcliVersion': '0.39.0'}}]}
HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: PythonPipBuilder:ResolveDependencies - Could not satisfy the requirement: requests
The above issues arise due to python PythonPipBuilder was not able to resolve the dependence. I had since log into docker and install the dependence manually, subsequently I suspected it was due to docker network issues.
Subsequently, the sam application was built by adding in additional flag which enable docker to use host network.
$(venv) sam build --use-container --docker-network host --debug
The output of the command:
Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
'build' command is called
Starting Build inside a container
No Parameters detected in the template
2 resources found in the template
Found Serverless function with name='HelloWorldFunction' and CodeUri='hello_world/'
Building resource 'HelloWorldFunction'
Fetching lambci/lambda:build-python3.7 Docker container image......
Mounting /home/ubuntu/test/sam-app/hello_world as /tmp/samcli/source:ro,delegated inside runtime container
Using the request object from command line argument
Loading workflow module 'aws_lambda_builders.workflows'
Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
Registering workflow 'GoDepBuilder' with capability 'Capability(language='go', dependency_manager='dep', application_framework=None)'
Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
Found workflow 'PythonPipBuilder' to support capabilities 'Capability(language='python', dependency_manager='pip', application_framework=None)'
Running workflow 'PythonPipBuilder'
Running PythonPipBuilder:ResolveDependencies
calling pip download -r /tmp/samcli/source/requirements.txt --dest /tmp/samcli/scratch
Full dependency closure: {requests==2.23.0(wheel), certifi==2019.11.28(wheel), urllib3==1.25.8(wheel), chardet==3.0.4(wheel), idna==2.9(wheel)}
initial compatible: {requests==2.23.0(wheel), certifi==2019.11.28(wheel), urllib3==1.25.8(wheel), chardet==3.0.4(wheel), idna==2.9(wheel)}
initial incompatible: set()
Downloading missing wheels: set()
compatible wheels after second download pass: {requests==2.23.0(wheel), certifi==2019.11.28(wheel), urllib3==1.25.8(wheel), chardet==3.0.4(wheel), idna==2.9(wheel)}
Build missing wheels from sdists (C compiling True): set()
compatible after building wheels (no C compiling): {requests==2.23.0(wheel), certifi==2019.11.28(wheel), urllib3==1.25.8(wheel), chardet==3.0.4(wheel), idna==2.9(wheel)}
Build missing wheels from sdists (C compiling False): set()
compatible after building wheels (C compiling): {requests==2.23.0(wheel), certifi==2019.11.28(wheel), urllib3==1.25.8(wheel), chardet==3.0.4(wheel), idna==2.9(wheel)}
Final compatible: {chardet==3.0.4(wheel), requests==2.23.0(wheel), certifi==2019.11.28(wheel), urllib3==1.25.8(wheel), idna==2.9(wheel)}
Final incompatible: set()
Final missing wheels: set()
PythonPipBuilder:ResolveDependencies succeeded
Running PythonPipBuilder:CopySource
PythonPipBuilder:CopySource succeeded
Build inside container returned response {"jsonrpc": "2.0", "id": 1, "result": {"artifacts_dir": "/tmp/samcli/artifacts"}}
Build inside container was successful. Copying artifacts from container to host
Copying from container: /tmp/samcli/artifacts/. -> /home/ubuntu/test/sam-app/.aws-sam/build/HelloWorldFunction
Build inside container succeeded
Build Succeeded
Built Artifacts : .aws-sam/build
Built Template : .aws-sam/build/template.yaml
Commands you can use next
=========================
[*] Invoke Function: sam local invoke
[*] Deploy: sam deploy --guided
Sending Telemetry: {'metrics': [{'commandRun': {'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam build', 'duration': 5544, 'exitReason': 'success', 'exitCode': 0, 'requestId': 'bd9e7b0a-82ac-40a8-a172-a2d49f0633ff', 'installationId': 'ce8ffa14-684f-4628-97fe-288848fcf73d', 'sessionId': '48762175-e559-4759-b2fa-6a66822e381e', 'executionEnvironment': 'CLI', 'pyversion': '3.7.6', 'samcliVersion': '0.39.0'}}]}
Credit also goes to my colleague Dr. Phetsouvanh Silivanxay to troubleshoot the issue together.

Up-level references ("..") in Bazel

In my bazel BUILD file, I have a line:
srcs = glob([<pattern1>, <pattern2>, ...])
I tried to have one of my patterns be "../dir/*.cc" but I get an error that I'm not allowed to use the .. sequence here.
Checking the documentation, I have found that it's not permitted, but I'm not sure what the expected substitute is.
Similarly, up-level references (..) and current-directory references (./) are forbidden.
How can I include these other source files in my srcs list given my current file structure? If I can't reference the up-level directory, is there a way to use the package name of the other directory instead?
Going "up" from your BUILD file would violate the package boundaries. If you really need that structure and cannot or don't want to change it, you have to make files from one package available to the other package by declaring the corresponding target(s) or at least export the files and making those visible. For instance assuming the following structure:
.
├── BUILD
├── WORKSPACE
├── hello.c
└── tgt
└── BUILD
It the // (top-level) package BUILD I could say:
filegroup(
name = "hello",
srcs = ["hello.c"],
visibility = ["//tgt:__pkg__"],
)
(Could also be: exports_files(["hello.c"], ["//tgt:__pkg__"]) instead in which case I would refer to the file by its name //:hello.c from tgt.)
And inside //tgt (tgt/BUILD) it can then read:
cc_binary(
name="tgt",
srcs=["//:hello"],
)
Which would give me:
$ bazel run //tgt
WARNING: /tmp/bzl1/tgt/BUILD:3:10: in srcs attribute of cc_binary rule //tgt:tgt: please do not import '//:hello.c' directly. You should either move the file to this package or depend on an appropriate rule there
INFO: Analyzed target //tgt:tgt (11 packages loaded, 68 targets configured).
INFO: Found 1 target...
Target //tgt:tgt up-to-date:
bazel-bin/tgt/tgt
INFO: Elapsed time: 0.247s, Critical Path: 0.09s
INFO: 2 processes: 2 linux-sandbox.
INFO: Build completed successfully, 6 total actions
INFO: Build completed successfully, 6 total actions
Hello World!
Note: bazel still flags this as something weird and noteworthy going on. I have to say I do not disagree with it. The tree structure does not seem to correspond to the content very well.
Perhaps in this example the tgt package boundary is artificial and not actually useful? Or hello.c is in the wrong place.

Dart: How to fix the condition?

I'm a newbie. I create an angular application using the IDEA template and insert the code from the example:
<p *ngIf="true">
Expression is true and ngIf is true.
This paragraph is in the DOM.
</p>
An error occurs:
[INFO]
------------------------------------------------------------------------ [INFO] Starting Build [INFO] Updating asset graph completed, took 16ms
[SEVERE] angular on lib/app_component.dart: Template parse errors:
line 6, column 4 of AppComponent: ParseErrorLevel.FATAL: Can't bind to
'ngIf' since it isn't an input of any bound directive. Please check
that the spelling is correct, and that the intended directive is
included in the host component's list of directives.
^^^^^^^^^^^^ [INFO] Running build completed, took 650ms [INFO] Caching
finalized dependency graph completed, took 853ms [SEVERE]
build_web_compilers|entrypoint on web/main.dart (cached): Unable to
find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a
dev_dependency needs to move to a real dependency), or a build failure
(if importing a generated file).
Please check the following imports:
import 'package:untitled1/app_component.template.dart' as ng; from
untitled1|web/main.dart at 2:1
[SEVERE] build_web_compilers|entrypoint on test/app_test.dart
(cached): Unable to find modules for some sources, this is usually the
result of either a bad import, a missing dependency in a package (or
possibly a dev_dependency needs to move to a real dependency), or a
build failure (if importing a generated file).
Please check the following imports:
import 'package:untitled1/app_component.template.dart' as ng; from
untitled1|test/app_test.dart at 5:1
[SEVERE] build_web_compilers|entrypoint on
test/app_test.dart.browser_test.dart (cached): Unable to find modules
for some sources, this is usually the result of either a bad import, a
missing dependency in a package (or possibly a dev_dependency needs to
move to a real dependency), or a build failure (if importing a
generated file).
Please check the following imports:
import 'package:untitled1/app_component.template.dart' as ng; from
untitled1|test/app_test.dart at 5:1
[SEVERE] Failed after 1.6s
How to fix?
You need to list directives you use in the template in the #Component() annotation
import 'package:angular/angular.dart'
...
#Component(
selector: 'foo-bar',
templateUrl: 'foo_bar.html',
directives: [coreDirectives /* or NgIf */],
)

How to speed up bazel builds on Google Cloud Platform

I am using gcr.io/cloud-builders/bazel to build my images on google container build.
From the logs, it seems it spends most of the time setting up the workspace for bazel. This workspace does not change from build to build so I think could be pre-computed and stored in a new image.
How can I speed up these bazel builds on Google Cloud Platform?
Already have image (with digest): gcr.io/cloud-builders/bazel
Extracting Bazel installation...
........................
Loading:
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: com_github_golang_protobuf : new_go_repository is deprecated. Please migrate to go_repository soon.
WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: com_github_golang_glog : new_go_repository is deprecated. Please migrate to go_repository soon.
WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: org_golang_google_grpc : new_go_repository is deprecated. Please migrate to go_repository soon.
WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: org_golang_x_net : new_go_repository is deprecated. Please migrate to go_repository soon.
WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: com_github_gogo_protobuf : new_go_repository is deprecated. Please migrate to go_repository soon.
WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: com_github_grpc_ecosystem_grpc_gateway : new_go_repository is deprecated. Please migrate to go_repository soon.
WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: org_golang_google_genproto : new_go_repository is deprecated. Please migrate to go_repository soon.
Analyzing: target //:docker (4 packages loaded)
Analyzing: target //:docker (5 packages loaded)
Analyzing: target //:docker (6 packages loaded)
Analyzing: target //:docker (76 packages loaded)
Analyzing: target //:docker (78 packages loaded)
Analyzing: target //:docker (78 packages loaded)
Analyzing: target //:docker (79 packages loaded)
Analyzing: target //:docker (79 packages loaded)
Analyzing: target //:docker (80 packages loaded)
Analyzing: target //:docker (160 packages loaded)
Analyzing: target //:docker (160 packages loaded)
Analyzing: target //:docker (160 packages loaded)
Analyzing: target //:docker (160 packages loaded)
Analyzing: target //:docker (174 packages loaded)
Analyzing: target //:docker (174 packages loaded)
Analyzing: target //:docker (211 packages loaded)
INFO: Analysed target //:docker (286 packages loaded).
INFO: Found 1 target...
[0 / 1] BazelWorkspaceStatusAction stable-status.txt
[17 / 19] SHA256 external/golang/image/002.tar.gz.nogz.sha256
[42 / 281] no action running
[51 / 290] no action running
[63 / 302] no action running
[80 / 319] no action running
[101 / 340] no action running
[118 / 358] no action running
[138 / 378] no action running
[168 / 407] Compiling external/com_github_google_protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc [for host]; 0s linux-sandbox
[200 / 439] Compiling external/com_github_google_protobuf/src/google/protobuf/extension_set.cc [for host]; 1s linux-sandbox
INFO: From ProtoCompile assets/assets/assets.pb.gw.go:
assets/assets/assets.proto: warning: Import recipes.proto but not used.
INFO: From ProtoCompile assets/assets/assets.swagger.json:
assets/assets/assets.proto: warning: Import recipes.proto but not used.
INFO: From ProtoCompile assets/assets/assets.pb.go:
assets/assets/assets.proto: warning: Import recipes.proto but not used.
[522 / 697] GoCompile vendor/github.com/gorilla/mux/~lib~/go_default_library.o; 0s linux-sandbox
Target //:docker up-to-date:
bazel-bin/docker-layer.tar
INFO: Elapsed time: 331.343s, Critical Path: 13.73s
INFO: Build completed successfully, 737 total actions
EDIT: add cloudbuild file
cloudbuild.yaml:
steps:
- name: gcr.io/cloud-builders/bazel
args: ['run', '//:docker']
- name: gcr.io/cloud-builders/docker
args: ['tag', 'bazel:docker', '${_IMAGE_TAG}']
images: ['${_IMAGE_TAG}']
Container Builder doesn't offer this as a built-in at this time, but you can do it yourself.
Add one or more volumes to the build step(s) that output information that you want to restore in a later build. (See documentation on volumes.)
If necessary, modify those build steps to output the data you want to preserve into the path provided by the volume.
In a subsequent build step, use the gsutil build step to save all the data in the volume to a GCS bucket. (You can of course use some other utility to save it to some other place if you wish.)
In a later build, use gsutil to restore the data to the desired volume, and mount the volume into a subsequent build step.
There's an even easier way available now using Bazel Remote Caching.
Create a Cloud Storage bucket, then set the following in your .bazelrc:
build --remote_cache=https://storage.googleapis.com/<your bucket name>
build --google_default_credentials
Bazel will automatically cache actions in your Cloud Storage bucket, and they persist between builds. You can set automatic lifecycle management on your storage bucket to delete actions after a certain number of days.

CF push works nicely, automated deploy fails on Bluemix

I have a Java maven project that i deploy to Bluemix using cf push. Works like a charm. It has this manifest:
applications:
- services:
- Monitoring and Analytics-gm
- somedb
disk_quota: 1024M
hosts:
- someapp
name: someapp
path: target/someapp-0.0.2.war
domain: mybluemix.net
instances: 1
memory: 512M
However when I push my repository to hub.jazz.net and kick off build and deploy, the deploy step fails. I checked the artifacts in the build step and the war file got created.
The error message is:
Server error, status code: 400, error code: 170004, message: App staging failed in the buildpack compile phase
What do I miss?
Update
The last lines from the successful build script:
[INFO] Packaging webapp
[INFO] Assembling webapp [someapp] in [/home/jenkins/workspace/8c791c21-d195-9b03-f3ab-1c2cb5a8a9b4/0d82aa76-8fb2-463b-b1d6-6ec80a763706/target/someapp-0.0.2]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/jenkins/workspace/8c791c21-d195-9b03-f3ab-1c2cb5a8a9b4/0d82aa76-8fb2-463b-b1d6-6ec80a763706/src/main/webapp]
[INFO] Webapp assembled in [56 msecs]
[INFO] Building war: /home/jenkins/workspace/8c791c21-d195-9b03-f3ab-1c2cb5a8a9b4/0d82aa76-8fb2-463b-b1d6-6ec80a763706/target/someapp-0.0.2.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.424 s
[INFO] Finished at: 2015-09-15T10:59:52+00:00
[INFO] Final Memory: 17M/27M
[INFO] ------------------------------------------------------------------------
Uploading artifacts ...
UPLOAD SUCCESSFUL
Total time: 2 seconds
Finished: SUCCESS
As you can see the target/someapp-0.0.2.war is build which is the one referred to in the deploy script
The last lines from the failed deploy script
cf --version
/usr/bin/cf-orig/cf version 6.7.0-IDS-2014-12-04T10:56:46+00:00
+ echo 'Target: https://api.ng.bluemix.net'
Target: https://api.ng.bluemix.net
+ source _deploy.sh
++ cf push someapp
Updating app someapp in org someuser#ibm.com / space somespace as someuser#ibm.com...
OK
Uploading someapp...
Uploading app files from: /home/jenkins/workspace/8c791c21-d195-9b03-f3ab-1c2cb5a8a9b4/7c0cd4a8-8ecf-4020-ae82-fc567dd666e9
Uploading 1.9M, 37 files
Done uploading
OK
Stopping app app someapp in org someuser#ibm.com / space somespace as someuser#ibm.com...
OK
Starting app someapp in org someuser#ibm.com / space somespace as someuser#ibm.com...
-----> Downloaded app package (3.9M)
-----> Downloaded app buildpack cache (4.0K)
FAILED
Server error, status code: 400, error code: 170004, message: App staging failed in the buildpack compile phase
TIP: use 'cf logs someapp --recent' for more information
Build step 'Execute shell' marked build as failure
Finished: FAILURE
log from cf logs someapp --recent
2015-09-15T22:53:49.75+0800 [API/5] OUT Updated app with guid 0ac55e94-12b6-490c-99a9-22dfd96ef293 ({"name"=>"someapp"})
2015-09-15T22:54:06.06+0800 [API/5] OUT Updated app with guid 0ac55e94-12b6-490c-99a9-22dfd96ef293 ({"state"=>"STOPPED"})
2015-09-15T22:54:09.68+0800 [DEA/3] OUT Got staging request for app with id 0ac55e94-12b6-490c-99a9-22dfd96ef293
2015-09-15T22:54:15.04+0800 [API/6] OUT Updated app with guid 0ac55e94-12b6-490c-99a9-22dfd96ef293 ({"state"=>"STARTED"})
2015-09-15T22:54:15.22+0800 [STG/3] OUT -----> Downloaded app package (3.9M)
2015-09-15T22:54:15.40+0800 [STG/3] OUT -----> Downloaded app buildpack cache (4.0K)
2015-09-15T22:54:15.84+0800 [STG/0] OUT -----> Liberty Buildpack Version: v1.22-20150824-1104
2015-09-15T22:54:15.84+0800 [STG/0] ERR E, [2015-09-15T14:54:15.846523 #56] ERROR -- /var/vcap/data/dea_next/admin_buildpacks/b1841a6c-5f84-4c40-ac86-9f4d5e8f0643_e788f7b61c5fadd2fec138a1417cd3e1d345df32/lib/liberty_buildpack/buildpack.rb:50:in `rescue in drive_buildpack_with_logger': Compile failed with exception #<RuntimeError: No supported application type was detected>
2015-09-15T22:54:15.84+0800 [STG/0] ERR No supported application type was detected
2015-09-15T22:54:15.85+0800 [STG/0] OUT Staging failed: Buildpack compilation step failed
2015-09-15T22:54:16.70+0800 [API/6] ERR encountered error: App staging failed in the buildpack compile phase
I tried:
no path: in manifest.yml
path: target/someapp-0.0.2.war (that works on local cf push)
path: someapp-0.0.2.war
None of them worked
Aaarrgghh..... 5 hours of my life gone.
I deleted the project and recreated it. When checking the Build Archive Directory it had the entry target (seems to get added when you select mvn). Despite the fact that I tried with path: someapp-0.0.2.war, that didn't work.
Only after removing target and setting path: target/someapp-0.0.2.war the now clean project did build.
So lesson learned: When switching to a mvn build, remove the target from the Build Archive Directory
Yeah usually the error you got means if wasn't able to find the source for your app or the source for the app is wrong... You could also try adding the following line to manifest.yml.
buildpack: liberty-for-java
Your new manifest would be.
applications:
- services:
- Monitoring and Analytics-gm
- somedb
disk_quota: 1024M
hosts:
- someapp
name: someapp
path: target/someapp-0.0.2.war
buildpack: liberty-for-java
domain: mybluemix.net
instances: 1
memory: 512M

Resources