Skip to content

Code

To succeed in a data science project, you probably need code. In AskAnna you can push or upload code to your project. Besides uploading, you can also view the files including the content of the files.

Code can pop-up on different location. The main location is when you open a project. On the project page you will find a section code. Another location is the run page. On the run page you can find the code used for the run.

Code page

On the code section you find a bar related to the code with some information and options:

In the table you can find:

Name Description
Name The name of a file or directory. You can click on it to open the file.
Size The size of the file or files within the directory
Modified The date the file or directory was last modified

When you are in a directory, the first row will show . By clicking on the , you will go back to the parent directory.

Package ID

Every version of the code is made available in AskAnna as a package. Every new version of the code, is a new package. The package ID is a unique identifier of the specific version of your code.

In the bar you see by default the first four charactes of the code package unique ID. If you hoover the SUUID, you can see the full SUUID.

When you navigate through the code, the Package ID can be used as a breadcrump.

Download

You can download every version of the code. When you click download, you will download a ZIP file containing all files in the code directory.

Replace

There are two ways to replace a code version in AskAnna with a new version. When you can click the replace button you can find th following information as well.

Replace code

Push code

When you have installed 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.

The 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:

askanna push

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.

Adding a description

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.

Upload a ZIP file

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.

History

Code history

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:

Name Description
UUID 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.

View files

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.

View file

You can also view the content of the files in AskAnna. If possible we will format the code.

Besides the content of the file, you will also see a file bar. In this bar you see:

  • to go back
  • Name of the file
  • Size of the file
  • Button to Download the file
  • Button to copy the content of the file

View Jupyter Notebook

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

The file 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.

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

The push-target is a line where you define to which projects you want to push the code. An example:

push-target: https://askanna.eu/3Cpy-QMzd-MVko-1rDQ/project/1MLc-kMYD-puy2-iisO/

Job definition

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 askanna.yml.

name of the job:
  job:
    - pip install -r requirements.txt
    - python your_model.py
  output:
    result: models/model_summary.json
    artifact:
      - models/