Auto Jobs Applier AI Hawk Setup Guide
Auto_Jobs_Applier_AIHawk Installation Guide
This guide will help you set up and run the Auto_Jobs_Applier_AIHawk project on a Windows machine using Ubuntu via Windows Subsystem for Linux (WSL). We'll walk through installing Ubuntu, setting up the development environment, installing Chrome and Chromedriver, configuring the project, modifying the code to remove interactive prompts, automating script execution, and running the application.
Table of Contents
- Prerequisites
- Install Ubuntu via Microsoft Store
- Update and Upgrade Ubuntu
- Install Visual Studio Code on Windows
- Clone the Repository
- Set Up Python Virtual Environment
- Install Project Dependencies
- Install Google Chrome
- Install ChromeDriver
- Fixing a Known Bug
- Modify the Code to Remove Interactive Prompt
- Add Your Resume PDF
- Update Configuration Files
- Automate Script Execution with Cron
- Run the Application
- Troubleshooting
- Conclusion
Prerequisites
Before proceeding, ensure you have the following:
- Windows 10 or higher with WSL enabled.
- Administrator privileges on your Windows machine.
- Basic familiarity with command-line operations.
Install Ubuntu via Microsoft Store
-
Enable WSL (Windows Subsystem for Linux):
Open PowerShell as an administrator and run:
wsl --installThis command installs WSL and the latest Ubuntu distribution by default. If you already have WSL enabled, you can skip this step.
-
Restart Your Computer:
After enabling WSL, restart your computer if prompted.
-
Install Ubuntu:
- Open the Microsoft Store app on your Windows machine.
- Search for Ubuntu.
- Select the latest version (e.g., Ubuntu 22.04 LTS) and click Install.
- Once installed, launch Ubuntu from the Start menu.
- Follow the on-screen instructions to complete the initial setup, including creating a username and password.
Update and Upgrade Ubuntu
After installing Ubuntu, update the package lists and upgrade installed packages to ensure you have the latest updates.
-
Open the Ubuntu Terminal.
-
Run the Following Commands:
sudo apt update sudo apt upgrade -y
Install Visual Studio Code on Windows
-
Download Visual Studio Code (VS Code):
Visit the Visual Studio Code website and download the installer for Windows.
-
Install VS Code:
Run the downloaded installer and follow the installation prompts.
-
Install the Remote - WSL Extension:
- Open VS Code.
- Click on the Extensions icon in the Activity Bar on the side or press
Ctrl+Shift+X. - Search for Remote - WSL and install it.
This extension allows you to work seamlessly with your WSL environment directly from VS Code.
Clone the Repository
-
Open Visual Studio Code.
-
Open the WSL Terminal within VS Code:
- Press `Ctrl+`` (backtick) or go to View > Terminal.
- Ensure you're in the Ubuntu WSL environment.
-
Clone the Repository:
git clone https://github.com/feder-cr/Auto_Jobs_Applier_AIHawk.git -
Navigate to the Project Directory:
cd Auto_Jobs_Applier_AIHawk
Set Up Python Virtual Environment
Creating a virtual environment ensures that project dependencies are isolated from other projects.
-
Create a Virtual Environment Named
virtual:python3 -m venv virtual -
Activate the Virtual Environment:
source virtual/bin/activateYou should see
(virtual)prefixed in your terminal prompt, indicating that the virtual environment is active.
Install Project Dependencies
With the virtual environment activated, install the required Python packages.
-
Install Dependencies from
requirements.txt:pip install -r requirements.txtEnsure that the
requirements.txtfile exists in the project directory and lists all necessary packages.
Install Google Chrome
-
Download the Google Chrome Debian Package:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -
Install the Package:
sudo dpkg -i google-chrome-stable_current_amd64.deb -
Fix Any Dependency Issues:
If you encounter dependency errors during installation, run:
sudo apt-get install -f -
Verify the Installation:
google-chrome --versionExpected Output:
Google Chrome 129.0.6668.70
Install ChromeDriver
To ensure compatibility between Chrome and ChromeDriver, download the ChromeDriver version that matches your installed version of Google Chrome.
-
Check Your Google Chrome Version:
google-chrome --versionExample Output:
Google Chrome 129.0.6668.70 -
Download the Corresponding ChromeDriver:
Visit the Chrome for Testing page to find the appropriate ChromeDriver version.
Example for Version 129.0.6668.70:
wget https://chromedriver.storage.googleapis.com/129.0.6668.70/chromedriver_linux64.zip -
Install Unzip (If Not Already Installed):
sudo apt install unzip -
Extract the Downloaded ZIP File:
unzip chromedriver_linux64.zip -
Move ChromeDriver to a Directory in PATH:
sudo mv chromedriver /usr/local/bin/ -
Grant Execute Permissions to ChromeDriver:
sudo chmod +x /usr/local/bin/chromedriver -
Verify ChromeDriver Installation:
chromedriver --versionExpected Output:
ChromeDriver 129.0.6668.70 (abcdef1234567890abcdef1234567890abcdef12) -
Ensure ChromeDriver is Accessible:
which chromedriverExpected Output:
/usr/local/bin/chromedriver
Fixing a Known Bug
There is a known issue in the project where ChromeDriver is incorrectly referenced with a .exe extension in a Linux environment. To fix this:
-
Locate the
utils.pyFile:The file path provided seems to be:
./virtual/lib/python3.12/site-packages/lib_resume_builder_AIHawk/utils.pyNavigate to the directory containing the
manager_facade.pyfile:cd virtual/lib/python3.10/site-packages/lib_resume_builder_AIHawk/ -
Edit the
manager_facade.pyFile:Open the file using VS Code or a text editor:
code utils.py -
Modificar o Caminho Executável do ChromeService
Localize a função choose_style e assegure-se de que ela aponte para o caminho correto do ChromeDriver sem a extensão .exe.
Antes (Função Original):
service = ChromeService(executable_path=chromedriver_path)
Depois (Função Modificada):
service = ChromeService(executable_path="/path/to/chromedriver")
-
Save the Changes:
- In VS Code, press
Ctrl + Sto save. - Exit the editor if desired.
- In VS Code, press
Modify the Code to Remove Interactive Prompt
To ensure that the script runs automatically without waiting for user input, we need to modify the choose_style function to select a default style programmatically.
-
Locate the
utils.pyFile:The file path provided seems to be:
./virtual/lib/python3.10/site-packages/lib_resume_builder_AIHawk/manager_facade.pyNavigate to the directory containing the
manager_facade.pyfile:cd virtual/lib/python3.10/site-packages/lib_resume_builder_AIHawk/ -
Edit the
manager_facade.pyFile:Open the file using VS Code or a text editor:
code manager_facade.py -
Modify choose_style function arround line 52:
Before (Original Function):
def choose_style(self):
styles = self.style_manager.get_styles()
if not styles:
print("No styles available")
return None
final_style_choice = "Create your resume style in CSS"
formatted_choices = self.style_manager.format_choices(styles)
formatted_choices.append(final_style_choice)
selected_choice = self.prompt_user(formatted_choices, "Which style would you like to adopt?")
if selected_choice == final_style_choice:
tutorial_url = "https://github.com/feder-cr/lib_resume_builder_AIHawk/blob/main/how_to_contribute/web_designer.md"
print("\nOpening tutorial in your browser...")
webbrowser.open(tutorial_url)
exit()
else:
self.selected_style = selected_choice.split(' (')[0]
After (Modified Function) Option1:
def choose_style(self):
styles = self.style_manager.get_styles()
if not styles:
print("No styles available")
return None
final_style_choice = "Create your resume style in CSS"
formatted_choices = self.style_manager.format_choices(styles)
formatted_choices.append(final_style_choice)
# **Automate Style Selection:**
# Select a default style without prompting the user.
# You can choose to select the first available style or specify a particular one.
# **Option 1: Select the First Available Style**
if formatted_choices:
selected_choice = formatted_choices[0] # Automatically select the first style
print(f"Selected default style: {selected_choice}")
else:
selected_choice = final_style_choice
After (Modified Function) Option 2:
def choose_style(self):
styles = self.style_manager.get_styles()
if not styles:
print("No styles available")
return None
final_style_choice = "Create your resume style in CSS"
formatted_choices = self.style_manager.format_choices(styles)
formatted_choices.append(final_style_choice)
# **Automate Style Selection:**
# Select a default style without prompting the user.
# You can choose to select the first available style or specify a particular one.
# **Option 2: Specify a Particular Default Style**
# Uncomment and modify the following lines if you prefer a specific style.
# default_style_name = "Default (style author -> https://github.com/krishnavalliappan)"
# if default_style_name in formatted_choices:
# selected_choice = default_style_name
# print(f"Selected default style: {selected_choice}")
# else:
# selected_choice = formatted_choices[0] # Fallback to first style
# print(f"Default style not found. Selected first available style: {selected_choice}")
if selected_choice == final_style_choice:
tutorial_url = "https://github.com/feder-cr/lib_resume_builder_AIHawk/blob/main/how_to_contribute/web_designer.md"
print("\nOpening tutorial in your browser...")
webbrowser.open(tutorial_url)
exit()
else:
self.selected_style = selected_choice.split(' (')[0]
print(f"Resume will be generated using the '{self.selected_style}' style.")
Explanation of Changes:
-
Removed Interactive Prompt:
- The
self.prompt_userfunction call has been removed to prevent the script from waiting for user input.
- The
-
Automate Style Selection:
-
Option 1: Automatically selects the first available style from the
formatted_choiceslist. - Option 2 (Commented Out): Allows you to specify a particular default style by name. Uncomment and modify as needed.
-
Option 1: Automatically selects the first available style from the
Note: Choose either Option 1 or Option 2 based on your preference. If you have a preferred default style, Option 2 offers more control.
Add Your Resume PDF
-
Create a Directory for Resumes (If Not Exists):
mkdir -p resumes -
Place Your Resume PDF in the
resumesDirectory:cp /path/to/your_resume.pdf resumes/Replace
/path/to/your_resume.pdfwith the actual path to your resume file.Or simple move using mouse in VSC.
Update Configuration Files
Ensure that the configuration files secrets.yaml, config.yaml, and plain_text_resume.yaml are properly configured with your specific details.
-
Open Each Configuration File in VS Code:
code secrets.yaml code config.yaml code plain_text_resume.yaml -
Update the Necessary Fields:
-
Save the Changes.
Automate Script Execution with Cron
To ensure that the Auto_Jobs_Applier_AIHawk script runs automatically every hour without manual intervention, we'll set up a cron job. This involves creating a shell script to activate the virtual environment and run the Python script, making the script executable, and scheduling it with cron.
📋 Table of Contents
- Create a Shell Script to Run the Python Script
- Make the Shell Script Executable
- Set Up the Cron Job
- Verify the Cron Job
- Monitor Cron Job Logs
- Troubleshooting
1. Create a Shell Script to Run the Python Script
To ensure that the Python script runs within the correct environment, we'll create a shell script that activates the virtual environment and executes the script.
-
Navigate to the Project Directory:
cd ~/Auto_Jobs_Applier_AIHawk -
Create a New Shell Script File:
Let's name the script
run_auto_jobs.sh.nano run_auto_jobs.sh -
Add the Following Content to the Script:
Replace
/home/proteusbr/Auto_Jobs_Applier_AIHawkwith the actual path to your project directory if it's different.#!/bin/bash # Navigate to the project directory cd /home/proteusbr/Auto_Jobs_Applier_AIHawk # Activate the virtual environment source virtual/bin/activate # Run the Python script with the default style python main.py --resume resume-job.pdf # Deactivate the virtual environment deactivateExplanation:
-
Shebang (
#!/bin/bash): Specifies that the script should be run in the Bash shell. -
cd: Navigates to the project directory. -
source virtual/bin/activate: Activates the Python virtual environment. -
python main.py --resume resume-job.pdf: Executes the Python script with the specified resume. -
deactivate: Deactivates the virtual environment after the script completes.
-
Shebang (
-
Save and Exit the Editor:
- Press
Ctrl + O, thenEnterto save. - Press
Ctrl + Xto exit.
- Press
2. Make the Shell Script Executable
To allow the script to be run, grant it execute permissions.
chmod +x run_auto_jobs.sh
3. Set Up the Cron Job
Cron is a time-based job scheduler in Unix-like operating systems. We'll configure it to run the shell script every hour.
-
Open the Crontab Editor:
crontab -e-
First-Time Setup: If prompted to choose an editor, select your preferred one (e.g.,
nano).
-
First-Time Setup: If prompted to choose an editor, select your preferred one (e.g.,
-
Add the Cron Job Entry:
At the end of the crontab file, add the following line:
0 * * * * /home/proteusbr/Auto_Jobs_Applier_AIHawk/run_auto_jobs.sh >> /home/proteusbr/Auto_Jobs_Applier_AIHawk/cron.log 2>&1Explanation:
-
0 * * * *: Specifies that the job runs at minute0of every hour. -
/home/proteusbr/Auto_Jobs_Applier_AIHawk/run_auto_jobs.sh: Full path to the shell script. -
>> /home/proteusbr/Auto_Jobs_Applier_AIHawk/cron.log 2>&1: Redirects both standard output and errors tocron.logfor logging purposes.
-
-
Save and Exit the Crontab Editor:
- In
nano, pressCtrl + O,Enterto save. - Press
Ctrl + Xto exit.
- In
4. Verify the Cron Job
To ensure that the cron job has been added successfully:
crontab -l
Expected Output:
0 * * * * /home/proteusbr/Auto_Jobs_Applier_AIHawk/run_auto_jobs.sh >> /home/proteusbr/Auto_Jobs_Applier_AIHawk/cron.log 2>&1
This confirms that the cron job is scheduled to run hourly.
5. Monitor Cron Job Logs
Regularly check the cron.log file to monitor the execution of your script and identify any potential issues.
-
View the Last Few Entries:
tail -n 20 /home/proteusbr/Auto_Jobs_Applier_AIHawk/cron.log -
Follow the Log in Real-Time:
tail -f /home/proteusbr/Auto_Jobs_Applier_AIHawk/cron.log- This command continuously displays new log entries as they are appended.
Tips:
- Successful Execution: Look for log entries indicating that the script ran without errors.
- Errors: If errors are present, they will be logged here. Use these logs to troubleshoot issues.
./Auto_Jobs_Applier_AIHawk/app_config.py MINIMUM_WAIT_TIME = 5
./Auto_Jobs_Applier_AIHawk/src/utils.py def chrome_browser_options(): options.add_argument("--headless")
./Auto_Jobs_Applier_AIHawk/src/aihawk_job_manager.py timeout=0
6. Troubleshooting
If the cron job isn't executing as expected, consider the following troubleshooting steps:
a. Check Cron Service Status
Ensure that the cron service is running.
sudo service cron status
-
If Not Running: Start the cron service.
sudo service cron start
b. Verify Script Paths and Permissions
-
Absolute Paths: Ensure that all paths in the shell script are absolute.
-
Execute Permissions: Confirm that the shell script and
chromedriverhave execute permissions.ls -l /home/proteusbr/Auto_Jobs_Applier_AIHawk/run_auto_jobs.sh ls -l /usr/local/bin/chromedriverExpected Output:
-rwxr-xr-x 1 proteusbr proteusbr ... run_auto_jobs.sh -rwxr-xr-x 1 root root ... /usr/local/bin/chromedriver
c. Environment Variables
Cron jobs run in a limited environment. Ensure that any necessary environment variables are set within the shell script.
For example, in run_auto_jobs.sh, you can set environment variables before activating the virtual environment:
#!/bin/bash
# Redireciona toda a saída para cron.log
exec >> /home/proteusbr/Auto_Jobs_Applier_AIHawk/cron.log 2>&1
# Insere um timestamp
echo "----- $(date) -----"
# Define a variável de ambiente TERM
export TERM=xterm
# Navega para o diretório do projeto
cd /home/proteusbr/Auto_Jobs_Applier_AIHawk || { echo "Failed to navigate to project directory"; exit 1; }
# Ativa o ambiente virtual
source virtual/bin/activate || { echo "Failed to activate virtual environment"; exit 1; }
# Executa o script Python principal usando o caminho absoluto
/home/proteusbr/Auto_Jobs_Applier_AIHawk/virtual/bin/python main.py --resume resume-job.pdf || { echo "Python main script failed"; exit 1; }
# Desativa o ambiente virtual
deactivate
echo "Script executed successfully."
./Auto_Jobs_Applier_AIHawk/app_config.py MINIMUM_WAIT_TIME = 5
./Auto_Jobs_Applier_AIHawk/src/utils.py def chrome_browser_options(): options.add_argument("--headless")
./Auto_Jobs_Applier_AIHawk/src/aihawk_job_manager.py timeout=0
d. Script Output
Review the cron.log for any error messages that can provide insights into what might be going wrong.
Modify the Code to Remove Interactive Prompt
To ensure that the script runs automatically without waiting for user input, we need to modify the choose_style function to select a default style programmatically.
📄 Original choose_style Function:
Located in ./virtual/lib/python3.10/site-packages/lib_resume_builder_AIHawk/manager_facade.py at line 52.
def choose_style(self):
styles = self.style_manager.get_styles()
if not styles:
print("No styles available")
return None
final_style_choice = "Create your resume style in CSS"
formatted_choices = self.style_manager.format_choices(styles)
formatted_choices.append(final_style_choice)
selected_choice = self.prompt_user(formatted_choices, "Which style would you like to adopt?")
if selected_choice == final_style_choice:
tutorial_url = "https://github.com/feder-cr/lib_resume_builder_AIHawk/blob/main/how_to_contribute/web_designer.md"
print("\nOpening tutorial in your browser...")
webbrowser.open(tutorial_url)
exit()
else:
self.selected_style = selected_choice.split(' (')[0]
🛠️ Modified choose_style Function:
def choose_style(self):
styles = self.style_manager.get_styles()
if not styles:
print("No styles available")
return None
final_style_choice = "Create your resume style in CSS"
formatted_choices = self.style_manager.format_choices(styles)
formatted_choices.append(final_style_choice)
# **Automate Style Selection:**
# Select a default style without prompting the user.
# You can choose to select the first available style or specify a particular one.
# **Option 1: Select the First Available Style**
if formatted_choices:
selected_choice = formatted_choices[0] # Automatically select the first style
print(f"Selected default style: {selected_choice}")
else:
selected_choice = final_style_choice
# **Option 2: Specify a Particular Default Style**
# Uncomment and modify the following lines if you prefer a specific style.
# default_style_name = "Default (style author -> https://github.com/krishnavalliappan)"
# if default_style_name in formatted_choices:
# selected_choice = default_style_name
# print(f"Selected default style: {selected_choice}")
# else:
# selected_choice = formatted_choices[0] # Fallback to first style
# print(f"Default style not found. Selected first available style: {selected_choice}")
if selected_choice == final_style_choice:
tutorial_url = "https://github.com/feder-cr/lib_resume_builder_AIHawk/blob/main/how_to_contribute/web_designer.md"
print("\nOpening tutorial in your browser...")
webbrowser.open(tutorial_url)
exit()
else:
self.selected_style = selected_choice.split(' (')[0]
print(f"Resume will be generated using the '{self.selected_style}' style.")
Explanation of Changes:
-
Removed Interactive Prompt:
- The
self.prompt_userfunction call has been removed to prevent the script from waiting for user input.
- The
-
Automate Style Selection:
-
Option 1: Automatically selects the first available style from the
formatted_choiceslist. - Option 2 (Commented Out): Allows you to specify a particular default style by name. Uncomment and modify as needed.
-
Option 1: Automatically selects the first available style from the
-
Feedback Messages:
- Added
printstatements to inform which style has been selected automatically. This is useful for logging and debugging purposes.
- Added
-
Maintain Functionality:
- The rest of the function remains unchanged to ensure that if the
final_style_choiceis selected, it behaves as intended (opens the tutorial and exits).
- The rest of the function remains unchanged to ensure that if the
Recommendation: If you have a preferred default style, Option 2 offers more control and ensures consistency. Otherwise, Option 1 is sufficient for general automation purposes.
Automate Script Execution with Cron
To ensure that the Auto_Jobs_Applier_AIHawk script runs automatically every hour without manual intervention, we'll set up a cron job. This involves creating a shell script to activate the virtual environment and run the Python script, making the script executable, and scheduling it with cron.
📋 Table of Contents
- Create a Shell Script to Run the Python Script
- Make the Shell Script Executable
- Set Up the Cron Job
- Verify the Cron Job
- Monitor Cron Job Logs
- Troubleshooting
1. Create a Shell Script to Run the Python Script
To ensure that the Python script runs within the correct environment, we'll create a shell script that activates the virtual environment and executes the script.
-
Navigate to the Project Directory:
cd ~/Auto_Jobs_Applier_AIHawk -
Create a New Shell Script File:
Let's name the script
run_auto_jobs.sh.nano run_auto_jobs.sh -
Add the Following Content to the Script:
Replace
/home/proteusbr/Auto_Jobs_Applier_AIHawkwith the actual path to your project directory if it's different.#!/bin/bash # Navigate to the project directory cd /home/proteusbr/Auto_Jobs_Applier_AIHawk # Activate the virtual environment source virtual/bin/activate # Run the Python script with the default style python main.py --resume resume-job.pdf # Deactivate the virtual environment deactivateExplanation:
-
Shebang (
#!/bin/bash): Specifies that the script should be run in the Bash shell. -
cd: Navigates to the project directory. -
source virtual/bin/activate: Activates the Python virtual environment. -
python main.py --resume resume-job.pdf: Executes the Python script with the specified resume. -
deactivate: Deactivates the virtual environment after the script completes.
-
Shebang (
-
Save and Exit the Editor:
- Press
Ctrl + O, thenEnterto save. - Press
Ctrl + Xto exit.
- Press
2. Make the Shell Script Executable
To allow the script to be run, grant it execute permissions.
chmod +x run_auto_jobs.sh
Test:
./run_auto_jobs.sh
3. Set Up the Cron Job
Cron is a time-based job scheduler in Unix-like operating systems. We'll configure it to run the shell script every hour.
-
Open the Crontab Editor:
crontab -e-
First-Time Setup: If prompted to choose an editor, select your preferred one (e.g.,
nano).
-
First-Time Setup: If prompted to choose an editor, select your preferred one (e.g.,
-
Add the Cron Job Entry:
At the end of the crontab file, add the following line:
0 * * * * /home/proteusbr/Auto_Jobs_Applier_AIHawk/run_auto_jobs.sh >> /home/proteusbr/Auto_Jobs_Applier_AIHawk/cron.log 2>&1Explanation:
-
0 * * * *: Specifies that the job runs at minute0of every hour. -
/home/proteusbr/Auto_Jobs_Applier_AIHawk/run_auto_jobs.sh: Full path to the shell script. -
>> /home/proteusbr/Auto_Jobs_Applier_AIHawk/cron.log 2>&1: Redirects both standard output and errors tocron.logfor logging purposes.
-
-
Save and Exit the Crontab Editor:
- In
nano, pressCtrl + O,Enterto save. - Press
Ctrl + Xto exit.
- In
4. Verify the Cron Job
To ensure that the cron job has been added successfully:
crontab -l
Expected Output:
0 * * * * /home/proteusbr/Auto_Jobs_Applier_AIHawk/run_auto_jobs.sh >> /home/proteusbr/Auto_Jobs_Applier_AIHawk/cron.log 2>&1
This confirms that the cron job is scheduled to run hourly.
5. Monitor Cron Job Logs
Regularly check the cron.log file to monitor the execution of your script and identify any potential issues.
-
View the Last Few Entries:
tail -n 20 /home/proteusbr/Auto_Jobs_Applier_AIHawk/cron.log -
Follow the Log in Real-Time:
tail -f /home/proteusbr/Auto_Jobs_Applier_AIHawk/cron.log- This command continuously displays new log entries as they are appended.
Tips:
- Successful Execution: Look for log entries indicating that the script ran without errors, such as confirmation of the selected style and successful resume generation.
- Errors: If errors are present, they will be logged here. Use these logs to troubleshoot issues.
6. Troubleshooting
If the cron job isn't executing as expected, consider the following troubleshooting steps:
a. Check Cron Service Status
Ensure that the cron service is running.
sudo service cron status
-
If Not Running: Start the cron service.
sudo service cron start
b. Verify Script Paths and Permissions
-
Absolute Paths: Ensure that all paths in the shell script are absolute.
-
Execute Permissions: Confirm that the shell script and
chromedriverhave execute permissions.ls -l /home/proteusbr/Auto_Jobs_Applier_AIHawk/run_auto_jobs.sh ls -l /usr/local/bin/chromedriverExpected Output:
-rwxr-xr-x 1 proteusbr proteusbr ... run_auto_jobs.sh -rwxr-xr-x 1 root root ... /usr/local/bin/chromedriver
c. Environment Variables
Cron jobs run in a limited environment. Ensure that any necessary environment variables are set within the shell script.
For example, in run_auto_jobs.sh, you can set environment variables before activating the virtual environment:
#!/bin/bash
# Set environment variables if needed
export SOME_ENV_VAR="value"
# Navigate to the project directory
cd /home/proteusbr/Auto_Jobs_Applier_AIHawk
# Activate the virtual environment
source virtual/bin/activate
# Run the Python script
python main.py --resume resume-job.pdf
# Deactivate the virtual environment
deactivate
d. Script Output
Review the cron.log for any error messages that can provide insights into what might be going wrong.
Run the Application
With all dependencies installed, configurations set, and automation in place, you can now run the application.
-
Ensure the Virtual Environment is Activated:
source virtual/bin/activate -
Navigate to the Project Directory (If Not Already There):
cd Auto_Jobs_Applier_AIHawk -
Run the Main Script with Your Resume:
python main.py --resume resumes/your_resume.pdfReplace
resumes/your_resume.pdfwith the path to your resume PDF.
Expected Outcome:
- The script should execute without asking for style selection.
- The resume should be generated using the selected default style.
- Logs should indicate successful execution.
Example Output:
Selected default style: Clean Blue (style author -> https://github.com/samodum)
Resume will be generated using the 'Clean Blue' style.
Troubleshooting
If you encounter any issues during setup or execution, consider the following troubleshooting steps:
1. Chromedriver Not Found or Incorrect Version
-
Ensure ChromeDriver Version Matches Chrome Version:
Verify that the ChromeDriver version matches your installed Google Chrome version.
google-chrome --version chromedriver --version -
Re-download ChromeDriver if Versions Mismatch:
If there's a mismatch, download the correct version from the Chrome for Testing site.
2. Permissions Issues
-
Grant Execute Permissions:
sudo chmod +x /usr/local/bin/chromedriver
3. Virtual Environment Issues
-
Activate Virtual Environment:
source virtual/bin/activate -
Reinstall Dependencies:
pip install -r requirements.txt
4. Configuration Errors
-
Double-Check Configuration Files:
Ensure that
secrets.yaml,config.yaml, andplain_text_resume.yamlhave the correct paths and credentials.
5. Selenium Errors
-
Check Selenium and WebDriver Installation:
Ensure that both Selenium and ChromeDriver are correctly installed and accessible.
-
Specify ChromeDriver Path Explicitly:
If Selenium cannot locate ChromeDriver, specify the path explicitly in your scripts as shown in the Fixing a Known Bug section.
6. General Debugging
-
Use Logging Outputs:
Check the logs for detailed error messages to identify where the issue is occurring.
-
Refer to Official Documentation:
Conclusion
By following this step-by-step guide, you have successfully set up and configured the Auto_Jobs_Applier_AIHawk project on your Windows machine using Ubuntu via WSL. The modifications to remove interactive prompts and the setup of a cron job ensure that your application runs automatically every hour, streamlining your job application process.
Summary of Steps:
- Install Ubuntu via WSL and Update It.
- Install Visual Studio Code with the Remote - WSL Extension.
- Clone the Repository and Set Up a Python Virtual Environment.
- Install Project Dependencies, Google Chrome, and ChromeDriver.
- Fix Known Bugs by Modifying the Code to Remove Interactive Prompts.
- Add Your Resume PDF and Update Configuration Files.
- Create a Shell Script and Set Up a Cron Job to Automate Execution.
- Run and Monitor the Application.
If you continue to experience issues, please refer to the troubleshooting section or reach out to the project maintainers for further assistance.
Good luck with your automated job applications! 🚀
Additional Tips
-
Use Environment Variables for Secrets:
For enhanced security, consider using environment variables to store sensitive information like LinkedIn credentials instead of hardcoding them in
secrets.yaml. -
Keep Software Updated:
Regularly update your system packages, Google Chrome, and ChromeDriver to ensure compatibility and security.
-
Backup Configuration Files:
Before making significant changes, back up your configuration files to prevent data loss.
-
Virtual Environment Management:
If you encounter issues with the virtual environment, consider deleting and recreating it to ensure a clean setup.
Why is this change necessary?
No response
Additional context
No response
Hey, @proteusbr1 Why do we need WSL when we can run the bot using just Windows
@proteusbr1 ask for a pr