What's the `da` tool referenced all over the ex-models samples? - daml

I have been following the daml documentation and managed to get the SDK 0.13.14 installed according to the documentation tutorials. However, when I check out the ex-models samples they all refer to a da tool, for example:
da compile
or
da run damlc -- test daml/CrowdFunding.daml
but there isn't any da executable in the path only the daml.
UPDATE I get the following error using daml build on the crowd-funding sample:
skywalker#Zeus:~/code/ex-models/crowd-funding$ daml build
daml build: Not in project.
daml: An unknown error has occured
context: Running build command.
details: Received ExitFailure 1 when running
Raw command: /home/skywalker/.daml/sdk/0.13.14/damlc/damlc build --project-check

da is a legacy tool that was only recently decommissioned. We have now updated the examples to use the new daml utility.
The new commands to use are:
daml build to compile the project
daml test --color to run all scenarios
I've now included makefiles in each project to run these conveniently.
Note that the error you're seeing with daml build comes from the fact that a project needs to be upgraded to work with the new tool. Previously, the da tool used da.yaml for the project configuration, the new daml tool uses daml.yaml.
You can use daml init to upgrade an old project to the new format (ie. converting da.yaml to the slightly different daml.yaml).

Related

Services and env in manifest file?

I have a web (online calculator for an example) which developed by my fellow tem members. Now they want to deploy in PCF using manifests.
Languages used : python, php and javascipt.
I gone through the docs about pcf with manifest.yml
In that I don't have any idea about services and env.
What is that services and how can I find the services for the above project and also how can I find the environment variables?
And tell whether these fields are mandatory to run the project in PCF.
To your original question:
What is that services and how can I find the services for the above project and also how can I find the environment variables? And tell whether these fields are mandatory to run the project in pcf.
Does your app require any services to run? Services would be things like a database or message queue. If it does not, then you do not need to specify any services in your manifest. They are optional.
Similarly, for environment variables, you would only need to set them if they are required to configure your application. Otherwise, just omit that section of your manifest.
At the end of the day, you should talk with whomever developed the application or read the documentation they produce as that's the only way to know what services or environment variables are required.
In regards to your additional questions:
1)And also I have one more query...like in our application we used python ok! In that we use lots of pacakages say pandas,numpy,scipy and so on...how can I import all the libraries into the PCF ??? Buildpacks will contain version only right?
Correct. The buildpack only includes Python itself. Your dependencies either need to be installed or vendored. To do this for Python, you need to include a requirements.txt file. The buildpack will see this and use pip to install your dependencies.
See the docs for the Python buildpack which explains this in more detail: https://docs.cloudfoundry.org/buildpacks/python/index.html#pushing_apps
2)And also tell me what will be the path for my app name if Java I can enclose jar files
For Java apps, you need to push compiled code. That means, you need to run something like mvn package or gradle assemble to build your executable JAR or WAR file. This should be a self contained file that has everything necessary to run your app, compile class files, config, and all dependent JARs.
You then run cf push -p path/to/my-app.jar (or WAR, whatever you build). The cf cli will take everything in the app and push it up to Cloud Foundry where the Java buildpack will install things like the JVM and possibly Tomcat so you app can run.
what should I do for application devloped using pyhton , JavaScript and php....
You can use multiple buildpacks. See the instructions here.
https://docs.cloudfoundry.org/buildpacks/use-multiple-buildpacks.html
In short, you can have as many buildpacks as you want. The last buildpack in the list is special because that is the buildpack which will set the start command for your application (although you can override this with cf push -c if necessary). The non-final buildpacks will run and simply install dependencies.
3) we were using postgresql how can I use this in pcf with my app
Run cf marketplace and see if there are any Postgres providers in your Marketplace. If there is one, you can just do a cf create-service <provider> <plan> <service name> and the foundation will create a database for you to use. You would then run a cf bind-service <app> <service name> to bind the service you create to your app. This will generate credentials and pass them along to your app when it starts. You app can then read the credentials out of VCAP_SERVICES and use them to make connections to the database.
See here for more details:
https://docs.cloudfoundry.org/devguide/services/application-binding.html
https://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES

Power BI Custom Visual - force directed graph API error

I'm trying to create a custom Force Directed Graph using the source code on Github (PowerBI-visuals-ForceGraph) and following the tutorial available at creating-a-custom-visual. Unfortunately, when I try to start the custom visual using the "pbiviz start" command in PowershellI I get an error stating "Invalid API version v2.3.0".
The "circlecard" example project used in the tutorial, which also uses API version v2.3.0 in it's pbiviz.json file, works just fine. So I'm clueless as to what's causing this error. I'm very new to trying out custom visuals on Power BI so any help with this is greatly appreciated.
Thanks in advance!
Try npm install and then npm run start, that should work :)
PowerBI-visuals-ForceGraph visual was converted to use the new version of powerbi-visuals-tools#beta
If you installed the tools as global by command:
npm i powerbi-visuals-tools --global
and run pbiviz start from global instance it will not work, because old tools doesn't support a new format of visual project.
npm run start - start powerbi-visuals-tools from local instance
specified in package.json of the visual:
https://github.com/Microsoft/PowerBI-visuals-ForceGraph/blob/master/package.json#L71
You need to install beta version of tool as global or run npm run start to use the new tools

Visual Studio Team Services Building JSON Scripts

I'm currently building scripts using Selenium Builder (which saves files as JSON) and i'm having a hard time running these scripts on VSTS. My question specifically is, can Visual Studio Team Services build JSON scripts and tie them in with its C.I.? If so, which approach must I take in order to do this / make it possible?
Thanks!
Here is my steps for your reference:
Deploy your own private build agent by following this link.
Configure the required environment on the build agent like Selenium Driver, Firefox so that the testing can be run on the build agent.
Upload the json file generated by Selenium Builder into VSTS Repository.
Create a build definition with two Command Line tasks: The first one runs npm install command to install se-interpreter:
And the second one run se-interpreter command to run the test in json file:
Queue the build, you will see the test been executed during the build:

gcloud beta functions command says "Invalid choice functions"

I'm following the google cloud functions tutorial here: https://cloud.google.com/functions/docs/quickstart
I install google-cloud-sdk and source both path.bash.inc and completion.bash.inc.
The gsutil command step works and creates the storage bucket.
When I run gcloud beta functions deploy helloWorld --stage-bucket [BUCKET_NAME] --trigger-topic hello_world replacing with my [BUCKET_NAME] I get usage help and the following error:
```
ERROR: (gcloud.beta) Invalid choice: 'functions'.
Valid choices are [app, auth, bigtable, compute, config, container, dataflow, dataproc, debug, deployment-manager, emulators, error-reporting, iam, init, logging, ml, organizations, projects, pubsub, service-management, source, sql, test].
```
I'm not sure how the gcloud command works, but I can see the functions directory in the lib/surface/ directory of the google-cloud-sdk.
Why does gcloud beta functions not work? How can I make it work?
Make sure you have the latest cloud SDK installed.
I got the same error and it seems I had version 137 while the latest is 152.
After running gcloud components update it was solved.
The functions are in subscription-only beta phase right now. From Quickstart:
Beta
This is a Beta release of Google Cloud Functions. This API might be
changed in backward-incompatible ways and is not subject to any SLA or
deprecation policy.
Want to get advance access to the latest and greatest? Click here to become a beta tester.
The gcloud cmd might be checking beta subscriptions. Did you subscribe?
Also make sure you have the most recent cloud SDK version.

Jenkins unable to generate test report due to NoClassDefFoundError - ParseResultCallable

I set up a Jenkins job to run some integration tests. After testing finishes, Jenkins should look for test report in settings. However, it gives following error:
Recording test results
ERROR: Publisher hudson.tasks.junit.JUnitResultArchiver aborted due to exception
java.lang.NoClassDefFoundError: hudson/tasks/junit/JUnitParser$ParseResultCallable
at hudson.tasks.junit.JUnitParser.parseResult(JUnitParser.java:90)
at hudson.tasks.junit.JUnitResultArchiver.parse(JUnitResultArchiver.java:120)
at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:137)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:74)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
at hudson.model.Run.execute(Run.java:1779)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Finished: FAILURE
Here is my Publish Junit result setting:
I checked the path for those xml files in workspace, they do exist. I'm not sure what could be wrong. My JUnit Plugin version is 1.5.
You have a version mismatch between the JUnit version in your build and the version that is loaded into Jenkins. https://issues.jenkins-ci.org/browse/JENKINS-24946 may provide some insight, but in general, you need to be very careful that the versions are compatible.
I think there is some configuration issue, somewhere in configuration it's not updating with latest version.
At some point of time you have to work with latest version.
Instead of downgrading just create a new branch of your project.
I created new branch of my project then build went smoothly although still it is failing with older branch. So better you work with latest version of JUNIt by creating new branch, jenkin will pick it automatically.
Also Wiping out Current Workspace may help