the AskAnna CLI, you can use a command line interface (a.k.a. terminal) to push code to AskAnna. The AskAnna CLI will look for a file
askanna.yml. Every file and directory in the "root directory" where the
askanna.yml file is, will be pushed to AskAnna.
As mentioned, the AskAnna CLI will look for a file
askanna.yml. If this file cannot be found in the current directoy, the CLI will go one level higher. If a the file cannot be found, the CLI will inform you. If you created a file
askanna.yml, you will also need to add the
push-target as a line in the file.
push-target is the URL of your project. In the replace section you can also copy the line you need to add to your project. Click replace, look for the line with
push-target and click the copy buttons on the right side of this line.
When you have done the configuration, you can simply push code to AskAnna via:
The AskAnna CLI will ask you a couple of questions. At the end the AskAnna CLI will make a ZIP file of your local direcoty, and push the code to AskAnna.
It is possible to add a push message by adding a description via:
askanna push -m "a description"
When you check the history page you can use this description to know what happened in a specific version.
If your local directory is also initiated as a
git directory, and you did not add a push message, then the latest git commit message will appear as the description of the code version.
Make a ZIP file from your local code directory. You can drag & drop this file to the dotted area, or you can click browse. When you click upload, the ZIP file will be uploaded to the AskAnna platform. After it has processed the new code version is available.
Uploading a new version is background process. You can continue using AskAnna, while uploading continues in the background. Next to your profile icon (right upper corner) you can find the current status of your upload.
When you click on
History you will see a list of all project code versions uploaded or pushed to AskAnna. On the history page you will find a table with the columns:
|SUUID||The unique ID of the Code package|
|Date created||When the code was uploaded or pushed to AskAnna|
|By||The member who uploaded or pushed to code to AskAnna|
|Description||Optionally a description.|
|Download||An option to download a ZIP file containing the version|
By clicking on a row, you can also open the specific code version.
You can view the content of a code directory. Every available file is listed. Although by default we push
.git directories, we will not show them in the interface.
You can also view the content of the files in AskAnna. If possible we will format the code. For HTML, JSON and Jupyter Notebook files we show a rendered version that we call pretty view. HTML and JSON files can also be viewed in their original format by changing the view.
Besides the content of the file, you will also see a file bar. In this bar you see:
In AskAnna we support viewing Jupyter Notebooks. When opening a Jupyter Notebook in AskAnna you will see it as a web page. If a table has more columns then what fits the screen, you can horizontal scroll to see more. Graphs are also presented as images.
askanna.yml contains the configuration of your project. In push code we already made a reference to define the
push-target in the file
askanna.yml. Here we will list more options about what you can configure in the file
askanna.yml should be located in the root path of the code directory.
In this file we use YAML syntax. To learn more about YAML syntax, you can check this Ansible page.
push-target is a line where you define to which projects you want to push the code. An example:
In the askanna.yml file you can define jobs. Below an example. On the documentation page for Jobs you can find more information about creating jobs via the
name of the job: job: - pip install -r requirements.txt - python your_model.py output: result: models/model_summary.json artifact: - models/
When you use the AskAnna CLI to push code to AskAnna, the CLI will automatically validate the
The first validation that will run is if the job names are valid. Job names that are not allowed:
Job schedules will also be checked by the validate function.
When you have a run with a schedule, and you did not specify a time zone in the
askanna.yml. For these jobs we run a check if the local system's time zone is not
UTC. If that's the case, we show an informative message. This message informs that you could set the time zone to run your jobs in the same time zone as your local system. On the page "Create a Job", you can read more about configuring time zones.
If you set notifications, we also run a validation if the configuration is valid. Not only the format, we also run if emails are valid.
When you use the AskAnna CLI to push code to your project, you might want to exclude some files or directories. Inspired by gitignore, we added support to ignore files and directories.
If you want to set files and directories that should not be pushed to AskAnna, you can add a file
.askannaignore. In this file, you list the files and directories that the push command should ignore. Some examples:
hello.pythen files with this name will not be pushed to AskAnna.
hello.*matches any file or folder whose name begins with
foo/will not push the directory
fooand paths underneath.
!will include the file or directory that matches the pattern. If you combine
!foo/hello.py, then all files and subdirectories of the directory
foo/will not be pushed, except the file
When you set the above examples in a file
askannaignore, it results in:
hello.py hello.* foo/ !foo/hello.py
On the gitignore page, you can find more patterns and examples.
If you manage your code with git and already have a file
.gitignore, you don't have to do anything. AskAnna will automatically use the
.gitignore specification. When AskAnna should not apply the
.gitignore file, you can add a file
In case you added files named
.gitignore. Then AskAnna will use the first matching file from the list: