In this project, we recommend using Visual Studio Code (VS Code) as the integrated development environment (IDE). However, you are free to use any IDE or text editor of your choice. Below are instructions to install and configure VS Code on Ubuntu.
Follow one of the methods below to install VS Code on your Ubuntu system:
- Open Terminal: Press
Ctrl + Alt + T
to open the terminal. - Install Snap (if not installed):
sudo apt update sudo apt install snapd
- Install VS Code using Snap:
sudo snap install code --classic
- Launch VS Code:
- Run the following command in the terminal:
code
- Alternatively, search for "Visual Studio Code" in the applications menu.
- Run the following command in the terminal:
-
Update and Install Prerequisites
Update your system and install the required packages:sudo apt update sudo apt install -y software-properties-common apt-transport-https wget
-
Import the Microsoft GPG Key
Import the GPG key to verify Microsoft packages:wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
-
Enable the VS Code Repository
Add the Visual Studio Code repository to your system:sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
-
Install VS Code
Update your package list and install Visual Studio Code: +bash sudo apt update sudo apt install code +bash -
Launch VS Code
To open Visual Studio Code:- Run the following command in the terminal:
code
- Alternatively, search for "Visual Studio Code" in the applications menu.
- Run the following command in the terminal:
Once Visual Studio Code is installed and launched, you can set up your project folder for easier development:
-
Open the Explorer Sidebar:
On the left-hand menu of VS Code, click the Explorer icon (usually the first icon at the top). -
Open the Project Folder:
- Click Open Folder at the top of the Explorer section or use the menu:
File → Open Folder. - Navigate to the Airflow home directory and open it:
Replace
/home/username/airflow
username
with your actual Ubuntu username.
- Click Open Folder at the top of the Explorer section or use the menu:
-
Access All Project Files:
After opening the folder, you will have access to all the files and folders needed for this project, such as:dags/
: Contains your DAG definitions.helpers/
: Contains custom scripts or modules used in your workflows.
-
Create or Edit Files:
You can now directly create or edit.py
files in their respective paths using VS Code. For example:- Add new DAG files in the
dags/
folder. - Place helper scripts in the
helpers/
folder.
- Add new DAG files in the
With this setup, you’re ready to begin developing and managing your Airflow project using Visual Studio Code!