<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Authenticate with the docker registry first
bash
gcloud auth configure-docker
If using TPUs please also authorize Cloud TPU to access your project as described here.
Set up your output bucket
Step1:  Build a base image to work with fairing
Step2:  Start an AI Platform job
<ASSISTANT_TASK:>
Python Code:
BUCKET = "gs://"  # your bucket here
assert re.search(r'gs://.+', BUCKET), 'A GCS bucket is required to store your results.'
Explanation: Authenticate with the docker registry first
bash
gcloud auth configure-docker
If using TPUs please also authorize Cloud TPU to access your project as described here.
Set up your output bucket
End of explanation
!cat Dockerfile
!docker build . -t {base_image}
!docker push {base_image}
Explanation: Build a base image to work with fairing
End of explanation
additional_files = '' # If your code requires additional files, you can specify them here (or include everything in the current folder with glob.glob('./**', recursive=True))
# If your code does not require any dependencies or config changes, you can directly start from an official Tensorflow docker image
#fairing.config.set_builder('docker', registry=DOCKER_REGISTRY, base_image='gcr.io/deeplearning-platform-release/tf-gpu.1-13')
# base image
fairing.config.set_builder('docker', registry=DOCKER_REGISTRY, base_image=base_image)
# AI Platform job hardware config
fairing.config.set_deployer('gcp', job_config={'trainingInput': {'scaleTier': 'CUSTOM', 'masterType': 'standard_p100'}})
# input and output notebooks
fairing.config.set_preprocessor('full_notebook',
                                notebook_file="05K_MNIST_TF20Keras_Tensorboard_playground.ipynb",
                                input_files=additional_files,
                                output_file=os.path.join(BUCKET, 'fairing-output', 'mnist-001.ipynb'))
# GPU settings for single K80, single p100 respectively
# job_config={'trainingInput': {'scaleTier': 'BASIC_GPU'}}
# job_config={'trainingInput': {'scaleTier': 'CUSTOM', 'masterType': 'standard_p100'}}
# These job_config settings for TPUv2
#job_config={'trainingInput': {'scaleTier': 'BASIC_GPU'}}
#job_config={'trainingInput': {'scaleTier': 'CUSTOM', 'masterType': 'n1-standard-8', 'workerType': 'cloud_tpu', 'workerCount': 1,
#                                               'workerConfig': {'accelerator_config': {'type': 'TPU_V2','count': 8}}}})
# On AI Platform, TPUv3 support is alpha and available to whitelisted customers only
fairing.config.run()
Explanation: Start an AI Platform job
End of explanation
<END_TASK>